Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DaveGee

macrumors 6502a
Original poster
Jul 25, 2001
677
2
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
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
7
- If the device is currently connected to wifi (aka not using cell-data)?

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

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

NSHost
 

DaveGee

macrumors 6502a
Original poster
Jul 25, 2001
677
2
On the iPhone Dev Center there is a how-to: "Determine whether the currently active network connection is Wi-Fi or cellular?"



NSHost

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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.