我用这个init方法继承CCMenuItemImage
-(id)initWithChildren:(id)targetedApplication {
if(self = [super initFromNormalImage:@"Answer_Box.png" selectedImage:@"Answer_Box.png" disabledImage:@"Answer_Box.png" target:targetedApplication selector:@selector(answerButtonTapped:)] ) {
NSLog(@"Yes?");
return self;
}
return self;
}
-(void)answerButtonTapped:(id)stuff {
NSLog(@"Answer Button Tapped");
}
并且每次在控制台中出现此错误都会崩溃
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil'
提前感谢您的帮助。
答案 0 :(得分:1)
是-answerButtonTapped一个靶向应用程序的方法?它应该是那一个。错误说目标中没有这样的功能。或者你可以传递“self”而不是“targetApplication”