How can I replace a UITableViewController with a UIViewController that contains a UITableView?
- by Dr Dork
I created a new SplitView iPad project in Xcode and setup the code to populate the TableView (in the RootView on the left) with data. Now I'd like to customize the RootView to contain a DatePicker view along with the TableView, but I'm unsure how to accomplish this. Since the default RootViewController is a subclass of a UITableViewController, I couldn't add a DatePicker view to it in IB (since you can't add a DatePicker to a UITableView). The only way I understand to accomplish my goal of adding a DatePicker to the "Left" RootView is to change the RootViewController from a subclass of a UITableViewController to a subclass of a UIViewController, then I'll be able to add a view to it that contains a DatePicker view and a TableView using IB. Questions...
Is this the correct approach to add a DatePicker to the "Left" RootView?
If so and I change the RootViewController to a subclass of a UIViewController (instead of a UITableViewController) and add to it a TableView (along with the DatePicker), how will that affect the code I currently have in place for populating my current TableView?
Thanks so much for all your help! Below is my current interface code for my RootViewController, if it'll help any.
@interface RootViewController : UITableViewController <NSFetchedResultsControllerDelegate> {
DetailViewController *detailViewController;
NSFetchedResultsController *fetchedResultsController;
NSManagedObjectContext *managedObjectContext;
}
@property (nonatomic, retain) IBOutlet DetailViewController *detailViewController;
@property (nonatomic, retain) NSFetchedResultsController *fetchedResultsController;
@property (nonatomic, retain) NSManagedObjectContext *managedObjectContext;
- (void)insertNewObject:(id)sender;
@end