I am using a segmented control with 2 segments on one of the tab bar items on my iPhone app. Essentially, I would like to display two different views when each segment is selected - one segment shows a tableview and the other segment shows a mapview.
So, when segment 1 is tapped, a tableview is displayed. And on tap of segment 2, a mapview is displayed. Each view has its own controller and is loaded from its own nib file. Is this possible?
I success开发者_StackOverflowfully created the two views (and controllers) and the two segment controls (on the navigation bar) via XCode but have no idea how to proceed next. Any suggestions and sample code to would be most appreciated.
The View Controller Programming Guide contains sample code and will help you in understanding how to achieve your task.
As far as i understand your situation, i think you should be able to connect the tab bar items to the view controllers with the Interface Builder by configuring the Tab Bar Items with the Inspector.
精彩评论