I happened across this recently, and I was wondering why this is designed as such.
If you have a UINavigationController
who has a child with a container view that has an embedded view controller in it, why does this child's self.navigationController
property not get set to something?
From the Apple Doc's on the subject:
The nearest ancestor in the view controller hierarchy that is a navigation controller. (read-only)
@property(nonatomic, readonly, retain) UINavigationController *navigationController Discussion If the receiver or one of its ancestors is a child of a navigation controller, this property contains the owning navigation controller. This property is nil if the view controller is not embedded inside a navigation controller.
To me, I would think because it's parent is embedded into the navigation controller, that it would pass it's reference down the chain to it's children. Am I missing something? Is there a good reason this is NOT the case?