标签:http io os ar for art sp cti on
#pragma mark -
#pragma mark - UIWebView Delegate Methods
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
static BOOL isRequestWeb = YES;
if (isRequestWeb) {
NSHTTPURLResponse *response = nil;
NSData *data = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:nil];
if (response.statusCode == 404) {
// code for 404
return NO;
} else if (response.statusCode == 403) {
// code for 403
return NO;
}
[webView loadData:data MIMEType:@"text/html" textEncodingName:nil baseURL:[request URL]];
isRequestWeb = NO;
return NO;
}
return YES;
}
标签:http io os ar for art sp cti on
原文地址:http://www.cnblogs.com/zhujin/p/3968209.html