1

I have set up a local server on which I have a database. I want my app, written in Xcode objective-C 6.1.1, to make NSURLRequests to the database on the local server in order to GET and POST data.

The problem is that NSURLRequests realises that I don't have a legit internet connection and sends me back an Status Code which says I don't have internet connection. I don't WANT internet connection, as a matter of fact I CAN'T have an internet connection in this current project.

How can I prevent NSURLRequest to check for internet connection? In the safari browser on whatever device I try to run my app I can access the data, but not in the app through NSURLRequest.

Any ideas?

5
  • What does it return? Commented Feb 3, 2015 at 22:10
  • It returns -1009, and the error message states that there is no internet connection. As soon as I have an internet connection it works flawlessly. Commented Feb 3, 2015 at 22:15
  • Please post the error code Commented Feb 3, 2015 at 22:15
  • This is the exact message from the localization on the NSError object: Internet appears to be offline, Status Code: -1009 Commented Feb 3, 2015 at 22:20
  • probably duplicate stackoverflow.com/questions/10080216/request-with-nsurlrequest Commented Feb 4, 2015 at 1:05

1 Answer 1

0

Issue was solved. Simple problem: Wrong url outside was trying to be reached instead of the url for the server...

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.