isDeviceUsingWifi? deviceIPAddress??

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

  1. macrumors 6502a

    Joined:
    Jul 25, 2001
    #1
    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?

    Dave
     
  2. Moderator emeritus

    kainjow

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

    NSHost
     
  3. thread starter macrumors 6502a

    Joined:
    Jul 25, 2001
    #3
    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...

    Dave
     

Share This Page