2012-04-12 10 views

Antwort

1

die Lösung gefunden

heben Sie die Kommentierung dieser Block in MainViewController.m

/* Comment out the block below to over-ride */ 
/* 

- (void) webViewDidStartLoad:(UIWebView*)theWebView 
{ 
    return [super webViewDidStartLoad:theWebView]; 
} 

- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error 
{ 
    return [super webView:theWebView didFailLoadWithError:error]; 
} 

- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType 
{ 
    return [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType]; 
} 
*/ 

und ersetzen diese komplette Funktion

- (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType 

mit

- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType 
{ 
    NSURL *url = [request URL]; 
    if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"]) 
    { 
     return YES; 
    } 
    else { 
     return [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ]; 
    } 
} 
Verwandte Themen