title: How can I link a local pdf file on html file - the html file is showing on UIWebView
body: <p>I am showing a local html file on my UiWebView using following code.</p>
  
  <pre><code>NSString *path = [[NSBundle mainBundle] pathForResource:@"test.html"];  
  
  NSString* htmlString = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];    
  
  NSString *bundlePath = [[NSBundle mainBundle] bundlePath];
  NSURL *baseURL = [NSURL fileURLWithPath:bundlePath];
  
  [_webView loadHTMLString:htmlString baseURL:baseURL];
  [_webView setBackgroundColor:[UIColor clearColor]];
  </code></pre>
  
  <p>App is showing the html correctly. In the test.html there is a link to local pdf file hello.pdf. This pdf is added to the project. But when I click on the link nothing happens. I want to load pdf on my web view when user clicks on the link.</p>
  
  <p>I want to use the UIWebView delegate to send requests for internet hyperlinks (e.g. <a href="http://www.google.com" rel="nofollow">http://www.google.com</a>) to the safari app.</p>
  
  <pre><code>-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType 
  {
      NSLog(@"%@",inRequest.URL.absoluteString);
      if([inRequest.URL.absoluteString rangeOfString:@"hello.pdf"].location == NSNotFound)
      {
          if ( inType == UIWebViewNavigationTypeLinkClicked ) 
          {
              [[UIApplication sharedApplication] openURL:[inRequest URL]];
              return NO;
          }
          return YES;
      }
      else
      {
         return NO; 
      }
  }
  </code></pre>