Take the 2-minute tour ×

I have an app that has a tabbarcontroller and for one tab I use a navigationcontroller.

Can someone tell me what the difference between [[self tabBarController] navigationController] and self.navigationController is?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

[[self tabBarController] navigationController] will get the navigationController that the tabBarController is inside.

self.navigationController gets the navigationController that self is inside.

These properties will return nil if the respective instances are not part of a navigationController's stack (if they aren't in a navigationController)

share|improve this answer
Cool, that makes sense, thanks –  mea36 Feb 12 '11 at 19:13

I think that [[self tabBarController] navigationController] is the current navigation controller of the selected tab. And self.navigationController is the navigation controller of the current class.

share|improve this answer


The navigationController property returns a navigation controller if the the controller the property is asked from is in the navigation controller's stack.

Your tab bar controller is not part of a navigation controller of the tab bar which should be nil in your case.

share|improve this answer

Your Answer


