views:

370

answers:

1

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?

A: 

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.

KennyTM
But, as I've mentioned, I have a two-level UITableView, so -...didSelectRowAtIndexPath: won't work
Knodel
@Knodel: You can determine whether you're in level 1 or 2 in `-…didSelectRowAtIndexPath:`.
KennyTM
How can I do it?
Knodel
@Knodel: How do you implement the root view controller for 2 levels?
KennyTM
I have a UITableViewController with 9 rows and 9 more corresponding UITableViewControllers
Knodel
@Knodel: Then you need to load the new page in the `-…didSelectRowAtIndexPath:` of the 9 corresponding UITableViewControllers.
KennyTM
Ok, I'll try this!
Knodel