0

I am developing an App with content that is crosslinked to other content.

The App contains 5 Tabs. Each Tab has it's Tableviews and detailsviews. From the detailview of a Tab, one can proceed to other items from another tab.

For Example: Tab 1 > TableView List Categories > TableView List Items > DetailView > TableView crosslinked Items > Tab 2 > DetailView

(Hope that makes any sense! :D)

When I activate the Tab 2 by tabbarController.selectedIndex = 1; it doesn't open the requested detailview but the TableView List Categories.

Is there a way of doing this?

Thanks!!

Douwe
  • 47
  • 6

1 Answers1

0

If DetailView is pushed by willSelectRowAtIndexPath or didSelectRowAtIndexPath of your UITableViewDelegate, than you need not only switch tab, but issue above mentioned call directly or call selectRowAtIndexPath of your UITableView (latter is better).

Correction!!!

I was not right above!!!! selectRowAtIndexPath doesn't cause the delegate to receive a tableView:willSelectRowAtIndexPath: or tableView:didSelectRowAtIndexPath: message. What to do? add new method pushDetailViewController into your TableViewController. Than in didSelectRowAtIndexPath easy call this new method. And now in method where your switch tab next call this method pushDetailViewController. That's all.

Valeriy Van
  • 1,851
  • 16
  • 19
  • Can you explain a bit more in detail please? I do push the DetailView With didSelectRowAtIndexPath. So where do I, as you describe, issue the above mentioned call directly or call selectRowAtIndexPath of my UITableView? Do I need to do that in the overview list (TableView) of the connected items or do I have to do that in the detailedview of the next tab. Thnx!! – Douwe Sep 21 '11 at 09:13
  • I was not right! selectRowAtIndexPath doesn't cause the delegate to receive a tableView:willSelectRowAtIndexPath: or tableView:didSelectRowAtIndexPath: message. What to do? add new method pushDetailViewController into your TableViewController. Than in didSelectRowAtIndexPath easy call this new method. And now in method where your switch tab next call this method pushDetailViewController. That's all. – Valeriy Van Sep 21 '11 at 10:16
  • Hi Valeriy! Thnx again for your input! Do I still need to do something like: tabbarController.selectedIndex = 1;? – Douwe Sep 21 '11 at 11:17
  • @Douwe, sure, if you need to switch tab. – Valeriy Van Sep 21 '11 at 13:22