Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8397733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:52:16+00:00 2026-06-09T20:52:16+00:00

I am using NSURLConnection to communicate with a web service on my LAN. When

  • 0

I am using NSURLConnection to communicate with a web service on my LAN. When using the Xcode Simulator everything works as expected. However, when using an iPhone the connection mostly times out (but not always).

The iPhone is connected to the LAN via wifi. I can consistently browse the web server (which is hosting the web service) using Safari.

However, the app mostly fails. It returns in the didFailWithError function reporting “The request timed out”.

The app will intermittently succeed (behaving exactly as expected). I can see no pattern for success or failure. It may fail several times and then succeed and then fail again (without restarting the app). I estimate a 90%+ failure rate.

The web service always receives the request and always responds. It appears the failure happens with the device not receiving or handling the response.

I can see no obvious problem with my network. Certainly there is no IP address clash.

I am completely new to apps, Apple, Xcode and iPhone. So this could be something really very obvious to you. Any ideas what I could look at to resolve this?

The environment I’m currently using for development is as follows:

  • Mac OS X (10.7.4)
  • Xcode 4 (targetting 4.3)
  • iPhone 3GS (5.1.1)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T20:52:17+00:00Added an answer on June 9, 2026 at 8:52 pm

    Obviously I cannot give you the absolute answer, but can hopefully help you track the problem down.

    First, you want vet your web service. Put a JPEG image in a public Dropbox folder. Now try to download that image with your code as well as view it with Safari. If Safari works but your code does not, then you know your code is the problem.

    If both fail then the phone may have a bad transceiver, or your WIFI network may be flakey. Take the phone to some public WIFI location and redo the test. If both still fail on a second network, the phone is probably defective.

    If in all cases Safari works but your code does not, then please post as much of your code as possible. Also, if using the asynchronous interface, are you getting redirected? Asked for credentials? Etc. I would be inclined to add every NSURLConnection delegate method and at least add a log so you know what’s going on – that is log all responses. You can also get the html return code from the response:

    assert([response isKindOfClass:[NSHTTPURLResponse class]]);
    NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; 
    htmlStatus = [httpResponse statusCode];
    if(htmlStatus != 200) NSLog(@"Server Response code %i", htmlStatus);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am downloading images using the NSURLConnection sendSynchronousRequest method and that works fine. However,
Riddle me this: I am using a NSURLConnection on an iPhone Simulator SDK 3.1.2
I'm using NSURLConnection to access a web service (on a .local host). When I
I am using NSURLConnection to download a zipped file from a web service. In
I m making call to server using NSURLConnection for iPhone & receiving the response
I am using NSURLConnection in an iPhone app as so: NSURLConnection *conn = [[NSURLConnection
how can i make complete data when using NSURLConnection? - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
When using NSURLConnection, there are several methods to be watching... I understand that connection:didReceiveResponse:
I'm using NSURLConnection and NSURLRequest to make a connection to a server for my
I am using NSURLConnection on the application. To create HTTP connection, I used following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.