As much as I like ASIHTTPRequest, it isn't documented anywhere how to use the modified the Reachability class, and I couldnt find it on stackoverflow, or any sample projects either.
Currently im at this point:
Reachability *reach = [Reachability reachabilityWithHostName:@"http://google.com"];
[reach startNotifier];
if ([reach isReachable]) {
NSLog(@"connection");
}else{
NSLog(@"no connection");
}
Which doesn't seem to work.
}
, Please make these changes then code gonna work like a charm :)
You need to set up a notification handler for this:
Then, implement the handler like so:
Also, when you don't need to know when things change, remove yourself as an observer: