title: COCOS2d CCLabelTTF not updating with player score - using a CCLayer Class
body: <p>I would be very grateful for any advice you can offer as I am growing increasingly frustrated with an issue I am having - I also appreciate that the issue I am having is due to my lack of knowledge / understanding.</p>
  
  <p>In an attempt to further my knowledge and stretch myself, I have chosen to create a PlayerStats class that handles the players scoring - and in time, health, etc.</p>
  
  <p>I have the GameLevelLayer and PlayerStats classes implemented as follows:</p>
  
  <p>GameLevelLayer.m as follows:</p>
  
  <pre><code>#import "GameLevelLayer.h"
  #import "Player.h"
  #import "PlayerStats.h"
  
  @interface GameLevelLayer() {
    CCTMXTiledMap *map;
    Player *player;
    PlayerStats *playerStats;
  }
  
  @end
  
  @implementation GameLevelLayer
  
  @synthesize grabber = _grabber;
  
  +(CCScene *) scene
  {
      CCScene *scene = [CCScene node];
      GameLevelLayer *layer = [GameLevelLayer node];
      PlayerStats *hudLayer = [PlayerStats node];
  
     [scene addChild: layer];
     [scene addChild: hudLayer];
  
  return scene;
  }
  
  -(id) init {
  
  if( (self=[super init]) ) {
  
      CGSize screenSize = [[CCDirector sharedDirector] winSize];
  
      playerStats = [[PlayerStats alloc]init];
      ...........
     }
  </code></pre>
  
  <p>PlayerStats.m is as follows:</p>
  
  <pre><code>-(id) init
     {
       if ((self = [super init])) {
  
       CGSize screenSize = [[CCDirector sharedDirector] winSize];
       score = [CCLabelTTF labelWithString:@"Score : 0" dimensions:CGSizeMake(100,20) hAlignment:UITextAlignmentRight fontName:@"Marker Felt" fontSize:(18.0)];
  
       int margin = 5;
  
       score.position = ccp(screenSize.width - (score.contentSize.width/2) - margin, score.contentSize.height/2 + margin);
  
       [self addChild:score z:99];
     }
       return self;
   }
  
  -(void)numberOfItemsCollected:(int)collected {
  
      NSString *str = [score string];
      CCLOG(@"What does the label say %@", str);
      // This is actually displaying the correct string of what the score should be .. 
  
      [score setString:[NSString stringWithFormat:@"Score : %d", collected]];
  
  
  }
  </code></pre>
  
  <p>When (from the GameLevelLayer.m) I initiate</p>
  
  <pre><code> [playerStats numberOfItemsCollected:5];
  </code></pre>
  
  <p>the CCLog shows that the label should show Score : 5 but the label itself does not update.</p>
  
  <p>Any advice would be greatly appreciated as I am very aware that I am misunderstanding the issue.
  I think the issue is to do with the Layer that I am updating not being the one I believe it is.... </p>
  
  <p>Thanks in advance.</p>