Hello,
I'm new with Obj-C and of course cocos2D.
Currently I want execute the methode of the parent scene of a layer:
I have definied a dummy method like this:
@implementation GameScene
- (int)getInt {
return 100;
}
@end
In the child layer I try to execute the method:
int i = [(GameScene*)self.parent getInt];
NSLog(@"Int from parent scene: %d", i);
But unfortunately the return from getInt is always "0".
What is getting wrong there?
It can't be so difficult just to execute a method of the parent object..
Thanks for any suggestions.
Regards
Jürgen