A tabBarController with a NavigationController and Tableview
Is there an easy way to do the following: I have an application which (currently) uses a Tableview to show database records. The records are all of the same type (table in the database) but belong to different Categories.
So I want to use a TabBar to change the data loaded (e.g. specify which category to load, the rest is all the same).
In the future I might want to add more functionality and other views (not based on the same articles), so I took comments onboard that it is better to have the Navigation Controller under the TabBar Controller. This will also allow the user, in the future when the a开发者_StackOverflow社区pplications expands, to easily re-arrange the tabBarItems.
But is there an easy way to utilize the same RootViewController for different TabBarButtons? And if not, what would be the easiest way to have Button1 load the RootView with category 1 and TabButton2 the same Rootview with Category 2. I am trying to use Interface Builder, but maybe it can only be done programmatically.
This article helped me a lot: http://b00gizm.posterous.com/how-to-embed-a-navigation-controller-inside-a
I figured out that it was easy by just using the index of the selected tab. The challenge i now to do sync the update-thread with the right controller among the different tabs, but that is another days work.
精彩评论