1

例子:

@class MyRootObject;

@interface MyObject : MyRootObject
@end

获取表单 XCode:

Class MyObject defined without specifying a base class.

MyRootObject 类是:

@interface MyRootObject : NSObject

- (id)init;

@end

@implementation MyRootObject

- (id)init
{
   self = [super init];

   if(self){
      // some code here
   }

   return self;
}

@end
4

1 回答 1

5

您不能从前向声明的类继承。您需要改为#include适当的标题。

于 2013-06-12T07:28:38.117 回答