I just added NetReachability.m/h to my project. I added the following code to NetReachability. I admit that this is a little cheesy. It's a one time only check but that will work correctly in many cases. I'm intending to change my code to create an instance of NetReachability and set the delgate and update my UI when the reachability status changes. Implementing the delegate callback seems simple.
Code:
+(BOOL)networkIsReachable:(BOOL)inByWiFiOnly
{
//Make sure we have a WiFi network up & running
NetReachability* _reachability = [[NetReachability alloc] initWithDefaultRoute:NO];
BOOL result = [_reachability isReachable];
if (inByWiFiOnly)
result = result && ! [_reachability isUsingCell];
[_reachability release];
return result;
}