How to get NSString "No Service" in status bar iphone

172 Views Asked by At

I have problem with detect sim, i was used CTCarry but not dectect when device "No Service" , Please help me how to detect it.

1

There are 1 best solutions below

3
On

Use the Reachability class from Apple:

Reachability *reachability = [Reachability reachabilityForInternetConnection];
[reachability startNotifier];

NetworkStatus status = [reachability currentReachabilityStatus];
switch(status) {
    case NotReachable:
        return @"No Service";
    case ReachableViaWiFi:
        ...
}

Alternatively you can use the SCNetworkReachability class directly.