Search code examples
xcodeipaduisplitviewcontroller

How to make a UIWebView in the DetailView of a Split View display data for a corresponding UITableViewItem selected in the Root View


I have an iPad app. In the Root View I have a UITableView with two levels. I need to display different webpages in the UIWebView in Detail View based on the selected UITableView row. How can I do it?


Solution

  • Connect the web view to somewhere accessible from the root view controller's table view delegate with interface builder (if you're using IB).

    In your root view controller's table view delegate's -…didSelectRowAtIndexPath:, load the new page for the web view depending on the selected index path.