I want to be able to check to see if the user is connected to WiFi, but not connected to a network. So basically I want to check the state of the WiFi button on the device setting page to check if button is enabled or disabled.
At the moment I can check to see if the Wifi is connected to a network or not connected to an network doing the following:
BOOL hasWiFiNetwork = NO;
NSArray *interfaces = CFBridgingRelease(CNCopySupportedInterfaces());
for (NSString *interface in interfaces)
{
    NSDictionary *networkInfo = CFBridgingRelease(CNCopyCurrentNetworkInfo((__bridge CFStringRef)(interface)));
    if (networkInfo != NULL)
    {
        hasWiFiNetwork = YES;
        break;
    }
    else
    {
        hasWiFiNetwork = NO;
        break;
    }
}
 
     
     
    