views:

66

answers:

1

Hi all,

I am working on an iPhone view that has some header text along with a UISegmentedControl at the top and a UITableView beneath it. When a different segment is selected in the UISegmentedControl, I need a different set of records to be displayed in the UITableView.

What is the best way to implement this? Should I have one UITableView for the view controller and just re-populate it when a different segment is selected? If so, can this be done with a NSFetchedResultsController / core data?

Thanks! -Johann

A: 

I'd suggest creating a different Table View Controller class for each one needed view. This will keep the logic of each view self-contained. Then instantiate, add and remove the subviews as needed when the user selects a different option. You would also be able to animate transitions from one to the next in some meaningful way.

If you decide later that one set of information would be better served using a different kind of view, you don't have to untangle everything.

mbmcavoy