in cocos2d for iphone i have two classes:
1- GameScene.h class
2- Player.h class
GameScene.h has this label scoreLabel2 declared as follows
@interface GameScene : CCLayer {
Player* player;
CCLabel* scoreLabel2;
and the player.h class has the following method
-(void)updateScore{
NSLog(@"%@",scoreLabel2);
}
I am getting this error
error: 'scoreLabel2' undeclared (first use in this function)
what is the best solution to that problem since I will need to use many objects and variables between my classes?
Many Thanks