Hello again. I have the following category:
@interface UIViewController (Additions)
- (void)exampleMethod;
@end
-----
#import "UIViewController+Additions.h"
@implementation UIViewController (Additions)
- (void)exampleMethod {
NSLog(@"Example.");
}
@end
I also have the following abstract class:
@interface DFAbstractViewController : UIViewController
@end
-----
#import "DFAbstractViewController.h"
#import "UIViewController+Additions.h"
@implementation DFAbstractViewController
@end
And here's the concrete class:
#import "DFAbstractViewController.h"
@interface DFConcreteViewController : DFAbstractViewController
@end
-----
#import "DFConcreteViewController.h"
@implementation DFConcreteViewController
- (void)viewDidLoad {
[self exampleMethod];
}
@end
Okay. So it's my understanding that the concrete class, DFConcreteViewController
, can use methods imported from a category in its superclass, DFAbstractViewController
. This is correct, because the method call works as expected.
The problem is Xcode is giving me the following warning: 'DFConcreteViewController' may not respond to '-exampleMethod'
.
I don't see how this method and its availability to DFConcreteViewController
isn't completely clear to the compiler? Perhaps I've misunderstood something about categories?