Hello,
I’m looking good practice to display local html files in webview of my detail view from a tableview.
Each cell is linked to a specific html file.
Can you help me ?
Sure, you can do that - UIWebView has a function loadHTMLString
that will be useful. Basically you want to store the local HTML in your app, load it as a string and pass it to UIWebView. NSFileManager will make things easy, and give you the ability to see if a file exists before you present it - this could be very useful if you use some kind of procedural name generation from your table view rather than hard-coding file names. For example you know you will have a series of 11 files, you simply name them 1 through 11.html and then load them by generating the filename with IndexPath.row.
Thank you,
Now I am reassured and i’ll can to continue working on my app following your valuable advice. I’ll look for good tutorials to learn.
Just to clarify, I can insert in my tableview (with links to my HTML files) a link to another tableview ?
If this is not possible, I guess I can use the principle of two sections: one for the html files and one for the link to the tableview …
So when you select a cell in your tableview you want to display another tableview? You would probably do performSegueWithIdentifier in the didSelectRowAtIndex method of the first tableview’s UITableViewDelegate object.
Thank you for your reply.
I found the solution that works correctly.