Reputation: 4923
Example:
@class MyRootObject;
@interface MyObject : MyRootObject
@end
Getting form XCode:
Class MyObject defined without specifying a base class.
MyRootObject class is:
@interface MyRootObject : NSObject
- (id)init;
@end
@implementation MyRootObject
- (id)init
{
self = [super init];
if(self){
// some code here
}
return self;
}
@end
Upvotes: 1
Views: 541
Reputation: 185831
You can't inherit from a forward-declared class. You need to #include
the appropriate header instead.
Upvotes: 5