Is it wise to use Reachability Class(from Apple) to check for a remote host\'s availability ? say for example, www.google.com
or should I use
NSStri
Here is a tutorial on how to use Reachability. http://www.raddonline.com/blogs/geek-journal/iphone-sdk-testing-network-reachability/
NSString *connectedString = [[NSString alloc] initWithContentsOfURL:[NSURL URLWithString:@"http://www.google.com/"]];
if ([connectedString length] != 0) // Host Available
The code you provided should also work but might not give the desired result.. Reachability is more reliable..