Q:

navigationController property is declared in UINavigationController.h but is a property of UIViewController

I am new to Ios development and I am following the Big nerd book to learn it. I have a confusion over the "navigationController".
for instance in my class that is an instance of  UITableViewController (same for any subclass of UIViewController as well) I have this :
[[self navigationController]
     pushViewController:detailViewController
     animated:YES];

when I look at apple documentation this navigationController seems to be a property of UIViewController, but is said that it is declared in UINavigationController.h !
I opened the UIviewcontroler.h and there is no property or method for navigationController, but as the documentation says it is indeed in UINavigationController.h
it does not make sense at all . first of all I know that a child class inherits the property and methods of the parent class, but UITableViewControler is by no mean a subclass of UINavigationController ,but a child of UiViewController . So hopefully some one understand what  I am asking. How I am able to access to this property when I am not inheriting from UINavigationController ? and how the documentation can show that as a property of UiViewController ?

A:

UINavigationController.h includes a UIViewController category that declares a navigationController property.
Remember, filenames are just conventions — they don't actually mean anything to the language. The code inside the files is what matters. Just because some code is inside UINavigationController.h doesn't mean it's inside the UINavigationController class. A header file "belonging" to one class is perfectly free to declare categories on other classes to help them interact with the class that the header is focused on.

