I'm writing the game in cocos2d (from Pablo Ruiz's book). Right now I have to create pause screen, and, according to the book, I have to create new function in AppDelegate.m (and in .h file) :
+(AppDelegate *) get {
return (AppDelegate *) [[UIApplication sharedApplication] delegate];
}
I'm getting errors : Expected a type; expected expression; Missing '[' at start of message send expression; Use of undeclared identifier 'AppDelegate'.
In another file, called GameScene.m, I created those functions:
-(void)resume
{
if(![AppDelegate get].paused)
{
return;
}
[AppDelegate get].paused = NO;
[self onEnter];
}
-(void)onExit
{
if(![AppDelegate get].paused)
{
[AppDelegate get].paused = YES;
[super onExit];
}
}
-(void)onEnter
{
if(![AppDelegate get].paused)
{
[super onEnter];
}
}
And I'm getting another set of errors : Use of undeclared identifier 'AppDelegate', four times.
Can someone explain me how to get rid of those errors?