Я пытаюсь сделать предупреждение при сбое подключения к интернету.
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
message:@"Can't connect. Please check your internet Connection"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
.h file
#import <UIKit/UIKit.h>
@interface wedstrijden : UIViewController {
IBOutlet UIWebView *webView;
}
@end
Код для веб-сайта html
NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://www.google.com"]];
UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0.f, 0.f, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height - 20.f)];
[webView setAutoresizingMask:(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth)];
[webView loadRequest:request];
[self.view addSubview:webView];
Нет ошибок, нет предупреждений .. ничего?!
Сеть подключена к: http://cl.ly/441B1m2Y0M0c2b0n1h2J