0

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

enter image description here

Hugo
  • 33
  • 8

1 Answers1

0

Probably your not add Reachability.m as Target Membership of your widget

Target Membership

Carlos Guzman
  • 363
  • 5
  • 11