Reputation: 1
Add a Webview Window to a existent iOS App that loads local stored HTML ... i am working on a app that loads a feed RSS and thats already done, but now the app needs a section that can be updated on a simple manner...
Upvotes: 0
Views: 116
Reputation: 1394
Your going to want to just drop a webview on in your xib, attatch it through your IBOutlet property, and then load your local stored HTML like the following:
NSError *fileReadError = nil;
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"HTMLFilename" ofType:@"html"];
NSString *fileContents = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&fileReadError];
if ( fileContents != nil )
{
[self.webView loadHTMLString:fileContents baseURL:nil];
}
Upvotes: 1