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?
views:
370answers:
1
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
2010-04-25 19:31:05
But, as I've mentioned, I have a two-level UITableView, so -...didSelectRowAtIndexPath: won't work
Knodel
2010-04-25 19:39:27
@Knodel: You can determine whether you're in level 1 or 2 in `-…didSelectRowAtIndexPath:`.
KennyTM
2010-04-25 19:45:44
How can I do it?
Knodel
2010-04-25 19:47:25
@Knodel: How do you implement the root view controller for 2 levels?
KennyTM
2010-04-25 19:57:17
I have a UITableViewController with 9 rows and 9 more corresponding UITableViewControllers
Knodel
2010-04-25 20:00:59
@Knodel: Then you need to load the new page in the `-…didSelectRowAtIndexPath:` of the 9 corresponding UITableViewControllers.
KennyTM
2010-04-25 20:11:29
Ok, I'll try this!
Knodel
2010-04-25 20:14:29