views:

32

answers:

1

In a Navigation-based application, the method pushViewController:animated can be used. This is a method of the UINavigationController class. However, nowhere in the source files do I see any #import statements that import this class. The documentation doesn't show UIViewController as inheriting from UINavigationController.

So how are Navigation-based applications able to access this method?

+1  A: 

UIViewController has a property called navigationController which is an instance of a UINavigationController. This is how it gets access to it.

jer
Then how come view-based applications, which use UIViewController, can't access pushViewController? Where is this property found?
awakeFromNib
Because the nav controller is set up for you when you use the navigation based template. If you don't use the nav template, you have to set up the property yourself.
jer