I have code to make this work on iOS. Using whatever I found here and around the Web I managed to get somewhere making the Cocoa Mac Os version, but the images do not load. CSS and Javascript doesn't seem to be loading either. The directory for the HTML is being added to the Resources group but it's being added as Folder References (blue folder) which makes Xcode respect the directory structure of the HTML App.
Here's the code I'm trying to use:
NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"index"
ofType:@"html"
inDirectory:@"/Patient_eMMR_HTML5" ];
NSString *html = [NSString stringWithContentsOfFile:htmlPath
encoding:NSUTF8StringEncoding
error:nil];
[[webView mainFrame] loadHTMLString:html baseURL:[NSURL fileURLWithPath:
[NSString stringWithFormat:@"%@/Patient_eMMR_HTML5/",
[[NSBundle mainBundle] bundlePath]]]];
This is the iOS version of the code from which I based the code I use above:
NSString *htmlPath = [[NSBundle mainBundle] pathForResource:@"index"
ofType:@"html"
inDirectory:@"/Patient_eMMR_HTML5" ];
NSString *html = [NSString stringWithContentsOfFile:htmlPath
encoding:NSUTF8StringEncoding
error:nil];
[webView loadHTMLString:html
baseURL:[NSURL fileURLWithPath:
[NSString stringWithFormat:@"%@/Patient_eMMR_HTML5/",
[[NSBundle mainBundle] bundlePath]]]];
Any help is greatly appreciated. Thanks.