- (BOOL) connectedToInternet
{
NSString *URLString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com"]];
return ( URLString != NULL ) ? YES : NO;
}
stringWithContentsOfURL <- 요놈이 deprecated됨.
NSError* error = nil;
NSString* text = [NSString stringWithContentsOfURL:TheUrl encoding:NSASCIIStringEncoding error:&error];
if( text )
{
NSLog(@"Text=%@", text);
}
else
{
NSLog(@"Error = %@", error);
}