Hey Guys,
I'm trying to create a settings screen for my iPad app. The user taps the settings button and a modal form comes up. I put two views on the form (a skinny one on the left for the settings, a wider one on the right for the details). What I want is for the left view to have a table view, when the user selects a row, the details for that row are loaded in to the detail view...
I'm using iOS 5 and Xcode 4.3. I used a static table view controller for the left view, got it loaded in as a child view and used a delegate to tell the parent which row the user taps. It's in this method that I'm having problems.
I have another table view controller for the first settings I want the user to be able to change. It's a simple table view, but I need a navigation bar at the top so they can have add and edit buttons.
This is how I load it:
If I run the app and choose the first row, it loads the table view with a navigation bar, but with 2 major flaws:
1) There is a 20 pixel gap (from my googling around, it has something to do with the status bar). In my storyboard, the modal form has its status bar set to none and the table view controller has its status bar set to none.
2) Only the edit button is visible, the title and add buttons are not, almost as off the nab bar keeps going...
If I comment out the UINavigationController stuff and uncomment the lines that are commented right now, then the table view controller fills the view properly, width and height wise, but then I have no way to add or edit items...
Any ideas what's going on? This is making me pull my hair out!
I'm trying to create a settings screen for my iPad app. The user taps the settings button and a modal form comes up. I put two views on the form (a skinny one on the left for the settings, a wider one on the right for the details). What I want is for the left view to have a table view, when the user selects a row, the details for that row are loaded in to the detail view...
I'm using iOS 5 and Xcode 4.3. I used a static table view controller for the left view, got it loaded in as a child view and used a delegate to tell the parent which row the user taps. It's in this method that I'm having problems.
I have another table view controller for the first settings I want the user to be able to change. It's a simple table view, but I need a navigation bar at the top so they can have add and edit buttons.
This is how I load it:
Code:
RatesTableViewController *ratesTVC = [storyboard instantiateViewControllerWithIdentifier:@"Rates Table View Controller"];
ratesTVC.managedObjectContext = self.managedObjectContext;
ratesTVC.view.frame = self.detailView.bounds;
/*
[self.detailView addSubview:ratesTVC.view];
[ratesTVC didMoveToParentViewController:self];
[self addChildViewController:ratesTVC];
*/
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:ratesTVC];
[self.detailView addSubview:navController.view];
[ratesTVC didMoveToParentViewController:self];
[self addChildViewController:navController];
If I run the app and choose the first row, it loads the table view with a navigation bar, but with 2 major flaws:
1) There is a 20 pixel gap (from my googling around, it has something to do with the status bar). In my storyboard, the modal form has its status bar set to none and the table view controller has its status bar set to none.
2) Only the edit button is visible, the title and add buttons are not, almost as off the nab bar keeps going...
If I comment out the UINavigationController stuff and uncomment the lines that are commented right now, then the table view controller fills the view properly, width and height wise, but then I have no way to add or edit items...
Any ideas what's going on? This is making me pull my hair out!