How to make same UIWebView take data from different local .html files?
- by Mike Rychev
I have an app, where there's one UIWebView and a UITableView. I don't want to create many .xib's, so I decided to make one .xib for all elements of the table. When user chooses a table element, the UIWebView appears and I want it to load data from different .html's depending on the name of the parent controller.
I tried this:
if (selectedTableElement==@"FirstElement") {
[childController.message loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"_" ofType:@"html"]isDirectory:NO]]];
}
And then
myWebView=message;
But it didn't work.
Thanks in advance!