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

lilmul123

macrumors newbie
Original poster
Jun 30, 2009
18
2
I would like to be able to change to different wi-fi connections from within my application; is this possible? If so, how?

Also, is there a way to determine the IP of the connection I am currently connected to within my app?
 
Is this not possible?

I would tend to doubt the ability to switch wi-fi connections within the app.
As for getting the IP address, there is definitely a way. I don't (explicitly) know that apple offers a way to do this internally.

A "hacky" way to do it would be to grab the source code of one of the pages that tells you your IP address (like IPChicken), since it would show up in the HTML source. Obviously this would only work when you are connected, but you would only have an IP when you are connected to the internet, but I would assume that 99% of the time you are connected to a WiFi connnection, you would be so that's not really a concern.

Obj-C doesnt offer much in the way of regular expressions, but you could certainly parse it out somehow. Be creative.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.