我正在尝试创建一个简单的CCNode子类,但我无法创建该对象.
它给出了错误" *因未捕获的异常而终止应用程序'NSInvalidArgumentException',原因:'* + [ContentPane <0x206898> init]:无法初始化类对象.'"
这是我的CCNode的子类:
#import "ContentPane.h"
@implementation ContentPane{
int content[8][4];
CCSprite *_rockPath1;
CCSprite *_rockPath2;
}
- (id)init {
self = [super init];
if (self) {
CCLOG(@"ContentPane created");
}
return self;
}
Run Code Online (Sandbox Code Playgroud)
@结束
这是我尝试启动它的地方:
- (void)didLoadFromCCB {
// tell this scene to accept touches
self.userInteractionEnabled = TRUE;
_counter = 0;
ContentPane *pane = [ContentPane init];
}
Run Code Online (Sandbox Code Playgroud)