I have 3 view controllers, vcA, vcB and vcC.
I am on vcA and push vcB. It works.
When I try to push vcC from vcB, it fails. I see that self.navigationController property of vcB is nil.
Reading the help file regarding to this property, I see this:
This property is nil if the view controller is not embedded inside a navigation controller.
So, vcB is probably not inside the navigation controller.
My question is, is self.navigationController pushViewController:vcB ... enough to embed vcB on the navigation controller? If not, how do I embed vcB on the navigation controller?
NB: vcA is built on Interface Builder and vcB and vcC are created programmatically.
After 3 days I finally solved this problem.
This problem is that the one of my viewControllers and the navigationController were both connected to the delegate’s rootViewController outlet. Thanks Xcode for not pointing that! Sorry but I have to say again that I hate Xcode 4 now more than ever.
The solution for this problem, was related with another problem I had and can be seen here: https://stackoverflow.com/a/13280574/316469
Thanks guys.