开发者

Activate Tab in UITabbarcontroller from other screen

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 o开发者_JAVA技巧f doing this?

Thanks!!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜