in my app i want to show an alert message when user has no internet connection i used the below code but it never enters to this block it never fires it never called
how can i control if user has internet connection or not?
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error
{
NSLog(@"connect");
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Connection Failed" message:@"check your internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alert show];
}
note: i use iOS 5.1 version and i have put my delegates in to the .h file