I presented a View using a call to presentModalViewController.
My new View didn’t have a navigation bar, so I added one from the Library but now when I created a UIBarButtonItem in viewDidLoad of my controller, and set it to rightBarButtonItem of the navigationBarItem.
But when I run my app, the Navigation bar is there but there is no button.
Did I miss a step or something ?
Just adding a navigation bar manually will not make the
self.navigationControllerproperty actual and it’s value isnil, which, I believe, you’re using for adding aUIBarButtonIteminstance.What I’d recommend is to declare a
UINavigationBarIBOutlet in your controller, connect it in NIB editor with navigation bar you’ve added and after that inviewDidLoaduse something like: