I have an app with a UIWebView inside a UIViewController. I load HTML from a web service as a string like this:
self.webView loadH
Add this in class..
@interface yourViewController : UIViewController
Add this in View did load
- (void)viewDidLoad
{
[description loadHTMLString:string baseURL:nil];
description.delegate = self;
}
Add this in your .m file
-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {
if ( inType == UIWebViewNavigationTypeLinkClicked ) {
[[UIApplication sharedApplication] openURL:[inRequest URL]];
return NO;
}
return YES;
}
Note:
UIWebView *description;
@synthesize description;
Then It will work perfectly the way you deserve..!! :)