I'm going to use an example to properly illustrate my confusion. I can't quite wrap my head around this.
In Cocoa touch, we have UIViewController
and its subclass, UINavigationController
. Now, UIVC
has an ivar of type UINav
, and to get around the circular import problem they use @class UINavigationController
. I am assuming they then #import "UINavigationController
in UIViewController.m
(or somesuch).
My confusion is thus: How do subclasses of UIViewController
then know about the methods declared in UINavigationController
? From inside a UIViewController subclass one might call [self.navigationController popViewController]
, but how is that method known?
The only idea I have is UINavigationController
must be separately imported to every subclass (perhaps in the prefix?)
Any ideas?