Check internet connection NSURL URLWithString

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

  1. macrumors newbie

    Joined:
    Jan 11, 2009
    #1
    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
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    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. thread starter macrumors newbie

    Joined:
    Jan 11, 2009
    #3

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

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    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. thread starter macrumors newbie

    Joined:
    Jan 11, 2009
    #5
    Thank you!

    i will try my best to get through it.

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

    caveman_uk

    Joined:
    Feb 17, 2003
    Location:
    Hitchin, Herts, UK
    #6
    Check the Apple Sample Code page for the 'Reachability' example
     

Share This Page