Take the 2-minute tour ×

I am receiving a description text in HTML format, and I am loading it in a webview, if a link clicked in the description so I load it in separate view controller. But shouldStartLoadWithRequest giving a some appended link. here is my code

if(navigationType == UIWebViewNavigationTypeLinkClicked) {

    WebsiteViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"WebsiteViewController"];
    vc.url = request.URL.absoluteString;
    NSLog(@"link is : %@", [[request URL] absoluteString]);
    [self.navigationController pushViewController:vc animated:YES];
    return false;
return true;

it prints this

link is : applewebdata://038EEEBF-A4C9-4C7D-8FB5-32056714B855/www.yahoo.com

and I am loading it like this

[webViewDescription loadHTMLString:description baseURL:nil];
share|improve this question

1 Answer 1

up vote 12 down vote accepted

As you are using loadHTMLString and you are setting baseURL to nil therefore applewebdata URI scheme is used by iOS instead of the “http” in URIs used for accessing internal resources on the device. You could try setting the baseURL

share|improve this answer
what should i put for the baseURL instead of baseURL:nil? –  Chris Suen Sep 19 '13 at 9:50
I ran into this problem, and in order to get the links to load correctly, I set the base URL as @"http://" –  BreadicalMD Oct 18 '13 at 21:56
Just a small fix. The baseURL argument takes an NSURL object, so it should be [NSURL URLWithString:@"http://"] not @"http://". –  Hlung Nov 25 '13 at 10:50

Your Answer


