Search code examples
iosobjective-cuinavigationcontroller

iOS, Objective C Presenting NavigationController modal and adding cancel button


I'm trying to present a View Controller modal. So i created a new Navigation Controller and called initWithRootViewController The Problem is that i want to create a cancel Button in the Navigation bar but i just can not do it. First of all is it even possible to set the button and text up on the navigation bar from outside and not in the Navigation Controller?

And if it is how can I do it because setting a new custom navigationItem does not work ?


Solution

  • Solved the problem on my own. The problem is that i had to set my cancel button in the root view controller and not from outside on the navigation controller.