isDeviceUsingWifi? deviceIPAddress??

Discussion in 'iOS Programming' started by DaveGee, Jul 28, 2008.

  1. macrumors 6502a

    Jul 25, 2001
    Okay this might be simple they might not... and they might just be the same routines that I'd use in a normal Cocoa application but here goes...

    Does anyone know code that can tell me:

    - If the device is currently connected to wifi (aka not using cell-data)?

    - What the device IP address is (again for wifi - not for cell-data)?

    I'm writing a program that need to talk to a specific piece of hardware that can only be connect to if you are on the same network as *it*... Aka you can't talk to it if you are going over the internet (even if you could I wouldn't want feature to work at the moment).

    Any ideas?

  2. Moderator emeritus


    Jun 15, 2000
    On the iPhone Dev Center there is a how-to: "Determine whether the currently active network connection is Wi-Fi or cellular?"

  3. thread starter macrumors 6502a

    Jul 25, 2001
    Ugh... NSHost dunno what I was thinking... :lol:

    And thanks for the heads up to the sample code I keep forgetting to check that stuff time and time again.. it actually has some fairly good stuff and it seems to be fairly well maintained...


Share This Page