Check internet connection is available or not in iphone
- (BOOL)connectedToInternet
if ([self connectedToInternet])
- (BOOL)connectedToInternet
{
NSString *URLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://iphonecodeapps.blogspot.com/"]];
return (URLString != NULL ) ? YES : NO;
}
if ([self connectedToInternet])
{
NSLog(@"Connected");
}
else
{
NSLog(@"Not Connected");
}
1 comments:
Thanks for sharing nice Code........
-------------------------------------------------------------------------------
iPhone App Development :: && ::Mobile and Web Application Development
Post a Comment