In cocos2d, I'm trying to call a method on the Parent of a CocosNode. The app works fine, but I get an 'Object' may not respond to 'method' warning. The parent is a subclassed Cocos2d layer, so I'm guessing I need to cast parent somehow, but that generates fatal errors.
The method is like this
if(CGRectContainsPoint([newBrick boundingBox], touchedStartPoint)){
[parent showChooser];
return kEventHandled;
}
I've tried adding the following, but with no success...
if(CGRectContainsPoint([newBrick boundingBox], touchedStartPoint)){
if([parent respondsToSelector:@selector(showChooser)]){
[parent showChooser];
}
return kEventHandled;
}
Any ideas?