UINavigationController pushViewController
I am working though a quiz app using a navigation controller and a child table view controller. I want to serve up the same child xib screen for each question.
Each time I present a new question, the prior screen remains on the stack. And when I hit the back button, it takes me to the prior screen / question, but I want to go back to 开发者_JAVA技巧the root controller's main screen instead. Do I need to override the navigation bar back button, or implement a customized popViewController? Or should I not be using pushViewController method?
You should replace the view controller's navigation item's leftBarButtonItem with a custom UIBarButtonItem that you can use to pop the navigation controller to the root view controller.
精彩评论