这是我的代码:
etc.h:
@interface etc : etc {
CCMenuItemFont * playButton;
}
- (void) playGame;
-----
etc.m:
//in the init
playButton = [CCMenuItemFont itemWithString:@"Play!" target:self selector:@selector(playGame:)];
[self addChild:playButton];
[playButton setPosition:ccp(290, 25)];
[CCMenuItemFont setFontSize:18];
[CCMenuItemFont setFontName:@"Helvetica"];
and then:
-(void) playGame {
NSLog(@"test");
setUp = 0;
[playButton removeFromParentAndCleanup:YES];
}
然而,它甚至从不触发测试字符串日志。我不知道该怎么办。