How to make same UIWebView take data from different local .html files?

Posted by Mike Rychev on Stack Overflow See other posts from Stack Overflow or by Mike Rychev
Published on 2010-03-24T18:11:05Z Indexed on 2010/03/24 18:13 UTC
Read the original article Hit count: 173

Filed under:
|
|

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!

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone