UINavigation in UIModalPresentationFormSheet
Not sure if someone can help me.
I am trying to create a UIModalPresentationFormSheet with navigation. I can load the view but i am not sure how to setup the navigation controller so when a row in the tableloaded loads the edit screen. At the moment it loads a uiviewcontroller with a tableview on it from the main screen. I need to allow editing on the table to add/edit delete records. When the user clicks either add or edit a new uiviewcontroller(detail view) is pushed to screen. It would be better if i had a navigation controller right? but i do need the edit buttons and back on the nave bar.
I think i have the button adding working its more just setting up the navigationcontroller
RootViewController - TableView select a row it loads the DetailViewController
DetailViewContoller - DetailView - Contains a button that loads the FormView as a UIModalPresentationFormSheet see link below.
FormView - Loads UIModalPresentationFormSheet Formsheet - Tableview with data in it. Editing this data loads the Form开发者_如何学GoDetailView http://www.bronron.com/iphoneDev/screen1.png
FormDetail view - viewcontroller with save and cancel buttons on nave bar http://www.bronron.com/iphoneDev/screen2.png
Any help would be greatly appreciated. Many thanks in advance
Thanks, Azz
When you load the UIModalPresentationFormSheet Formsheet, simply add:
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:/*the formsheet*/];
Then just add navController
to the modal view, instead of the root view. Then you will be able to add buttons and push viewControllers, etc.
Apple has ample documentation on these basic topics. Have a look at the Sample Code and Table Guide.
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:viewController];
nav.modalPresentationStyle = UIModalPresentationFormSheet;
精彩评论