I got a Notification Center Widget that contains some UISwitches that work only if connected to a Wi-Fi network.
I tried to do this with Reachability (that works in the normal app code), like this
#import "Reachability.h"
Reachability *reachability = [Reachability reachabilityForInternetConnection];
[reachability startNotifier];
NetworkStatus status = [reachability currentReachabilityStatus];
if(status == NotReachable) {
switch.enabled = NO;
} else if (status == ReachableViaWiFi) {
} else if (status == ReachableViaWWAN) {
switch.enabled = NO;
}
But I got these errors