Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 31st, 2012  |  syntax: None  |  size: 0.74 KB  |  hits: 50  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. - (BOOL)webView:(UIWebView *)theWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
  2. {
  3.         NSURLRequest* req = request;
  4.        
  5.         if ([[[request URL] absoluteString] isEqualToString: @"about:blank"]) {
  6.                 NSLog(@"Rewriting about:blank");
  7.                 NSString* app = [[NSBundle mainBundle] resourcePath];
  8.                 NSString* blankpath = [NSString stringWithFormat: @"%@/www/blank.html", app];
  9.                 NSURL* blankurl = [NSURL fileURLWithPath:blankpath];
  10.        
  11.                 req = [NSURLRequest requestWithURL: blankurl];
  12.         }
  13.  
  14.         return [ super webView:theWebView shouldStartLoadWithRequest:req navigationType:navigationType ];
  15. }