-(BOOL)connected
{
Reachability *reachability = [Reachability reachabilityForInternetConnection];
NetworkStatus networkStatus = [reachability currentReachabilityStatus];
return !(networkStatus == NotReachable);
}
if (![self connected]) {
NSLog(@"Not Connected");
} else {
NSLog(@"Connected");
// connected, do some internet stuff
}
The above code is perfectly working with Wifi.When i use 3G connectivity it is not working correctly.I do not know how to change code for 3G connectivity.any help will be appreciated.thanks in advance.