How to tell with Objective-C if the iPhone is connected to a wifi network?

iphone, networking, objective-c, wifi

Solution

Check out the Reachability sample.

Problem

In the context of an Objective-C, iPhone application, I need to be able to tell whether the iPhone is connected to a wifi network, and if possible listen to changes in this state. Does anyone know how to do this? thanks, gabouy

Original source