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?
[[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)
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.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.