1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Check internet connection NSURL URLWithString

Discussion in 'iPhone/iPad Programming' started by vidyareef, Jan 15, 2009.

  1. macrumors newbie

    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.



    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.

  2. Moderator


    Staff Member

    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 sample.
  3. macrumors newbie


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


    Staff Member

    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.
  5. macrumors newbie

    Thank you!

    i will try my best to get through it.

    Can U tell me what does, isAdHocWiFiNetworkAvailableFlags mean ?
  6. Guest


    Check the Apple Sample Code page for the 'Reachability' example

Share This Page