I am loading as secondary view with its own xib file. I can load it fine, but cannot get the webview in it to load any content. I have another app where this proces works, but it is in the main view.
Here is the code I am using.
@synthesize webView;
- (void)viewDidLoad
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"workshop" ofType:@"htm" inDirectory:@"dirA"];
NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];
NSString *htmlString = [[NSString alloc] initWithData:
[readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding];
// to make html content transparent to its parent view -
// 1) set the webview's backgroundColor property to [UIColor clearColor]
// 2) use the content in the html: <body style="background-color: transparent">
// 3) opaque property set to NO
//
webView.opaque = NO;
webView.backgroundColor = [UIColor clearColor];
[self.webView loadHTMLString:htmlString baseURL:nil];
[htmlString release];
}
- (void)dealloc
{
[webView release];
[super dealloc];
}
-(IBAction)switchCanary {
[self dismissModalViewControllerAnimated:YES];
}
-(IBAction)switchBack {
[self dismissModalViewControllerAnimated:YES];
}
@end