I am a new iPhone developer. I have created an iOS application where I have checked internet availability checking.
I have used the following method:
-(BOOL)connectedToInternet
{
NSString *URLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com"]
encoding:NSStringEncoding
error:nil];
return ( URLString != NULL ) ? YES : NO;
}
In the applicationDidFinishLaunching
I have called the method and show warning if no connection otherwise enter the second screen.
I have downloaded the app in my iPhone (iOS 4.3.1) and iPad (iOS 4.3.3). It successfully works.
But my client said that he download on his iPhone (iOS 4.3.5) and it always shows "No Internet Connection" warning.
I have searched several site to find the problem and a permanent solution. But I did not find what is my fault and why app not working all device.