PDA

View Full Version : Check internet connection NSURL URLWithString




vidyareef
Jan 15, 2009, 11:21 PM
Hi !

i am very new to programming in Xcode. Please can someone tell me how to check for internet connection in code or tell me some link where to find them.

As such i can pass the website values as NSURL URLWithString.

===

Hello!

can anyone tell me, how can i test in xcode/objective-C whether an internet connection is available or not.

To check internet connection first as such the application does not crash if content of the website are not available if no internet connection is connected.

Please try suggest some website for reference or some code which you already know.


Vidya



robbieduncan
Jan 16, 2009, 04:32 AM
I assume this is on the iPhone (as you've posted this in iPhone Programming). If so look at the sample code Apple provide, in particular the Reachability (http://developer.apple.com/iphone/library/samplecode/Reachability/index.html) sample.

vidyareef
Jan 19, 2009, 02:34 AM
I assume this is on the iPhone (as you've posted this in iPhone Programming). If so look at the sample code Apple provide, in particular the Reachability (http://developer.apple.com/iphone/library/samplecode/Reachability/index.html) sample.


Can you please suggest me something simpler. I am very new to xcode.

robbieduncan
Jan 19, 2009, 02:38 AM
Can you please suggest me something simpler. I am very new to xcode.

No. That is how it's done. If you can't understand the sample you need to spend more time learning about Objective-C/Cocoa.

vidyareef
Jan 19, 2009, 02:39 AM
Thank you!

i will try my best to get through it.

Can U tell me what does, isAdHocWiFiNetworkAvailableFlags mean ?

caveman_uk
Jan 19, 2009, 06:45 AM
Check the Apple Sample Code page for the 'Reachability' example