title: Objective-C access to counter from another class
body: <p>I´m new with objective-c and i have a question. I don´t understand where is my mistake.</p>
  
  <p>The most time the counter tells me that the value is 0.</p>
  
  <p>I have a game class, where is a counter. After a while when the Game stops the screen switch to the End class. And in the End class i want to print out the score. But it does not work.</p>
  
  <pre><code>Game.h    
  @interface Game : CCLayer
  {
    int counter;
  }    
  @property (readwrite, nonatomic) int counter;    
  +(int)returnCounter;    
  @end  
  Game.m    
  @implementation Game    
  @synthesize counter;    
  -(void)methodForMyCounter{
    counter++;
  }
      +(int)returnCounter{
  return counter;
  } 
  End.h    
  End.m    
  @implementation    
  -(void)getCounter{
    //here i want to print out the counter    
  }
  </code></pre>