The following code does not work with iOS5:
- (void)loadURL
{
NSString *path = [[NSBundle mainBundle] pathForResource:self.HTML ofType:@"html"];
NSString *markup = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
[self.webView loadHTMLString:markup baseURL:nil];
[markup release];
}
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType
{
if (navigationType == UIWebViewNavigationTypeLinkClicked)
{
// Another controller loads
return NO;
}
else
{
return YES;
}
}
When the web view loads, it does nothing, just an empty screen appears. When I run this in iOS 4.3 it loads the HTML from the bundle.