I am in the process of designing and coding an iPhone application to display movie times. I currently have a Movie Class which contains:
NSString title
NSSDate releaseDate
NSSDate score
My UI is a simple UINavigationController
which has a segmented control as it's title and UITableView
to display the Movies setup in Interface Builder. The segmented control has 3 segments: Title, Opening Date, and Score (on RottenTomatoes). The data for the table view is currently provided by a NSMutableArray movies
which is a property of the AppDelegate.
I know that I can register target actions using the following code, but I am unsure of how to sort the UITableView
data at this point:
[segmentedControl addTarget:self action:@selector(action:) forControlEvents:UIControlEventValueChanged];
How and where do I resort the UITableView
whenever the UISegmentedControl
selected segment changes?