我有这个:
//Node.h
@interface Node: CCSprite{
BOOL wasTouched;
}
-(BOOL)getTouched;
// some other methods
//Node.m
-(BOOL)getTouched{
return wasTouched;
}
-(id)init{
wasTouched=NO;
}
//wasTouched changes in the other methods..when they are called (no problem here)
//Game.m
//i make an array of nodes and do some stuff
-(void)someMethod{
for (Node *node in arrayOfNodes){
if ([node getTouched]) { //here it crashes
//code
}}}
它与消息一起崩溃-[CCSprite getTouched]: unrecognized selector sent to instance 0x236dd0
问题是:为什么?!