I have a class X which extends UIViewController. To my surprise this class can have the following code:
[self.navigationController popViewControllerAnimated:YES];
navigationController as far as I see, is a property added by a category in UINavigationController.h:
@interface UIViewController (UINavigationControllerItem)
@property(nonatomic,readonly,retain) UINavigationController *navigationController;
@end
My class extends UIViewController, not UINavigationController, and I see no way of this category being referred. I thought I had to import the category to access the members declared by it. So how UIViewController has access to a property declared in another, unrelated header file?
Thanks, Janos