title: Objective C: Call variable from another method
body: <p>I'm trying to access an NSTimer in a method called getTimer in another method.</p>
  
  <pre><code>- (NSTimer *)getTimer{      
  NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:1.5 target:self selector: @selector(produceBricks) userInfo:nil repeats:YES];
  return timer;
  [timer release];
  }
  </code></pre>
  
  <p>I'm trying to stop the timer in another method (a method that would pause the game) by using:</p>
  
  <pre><code>if ([getTimer.timer isValid]) {
      [getTimer.timer invalidate];
  }
  </code></pre>
  
  <p>I'm assuming this is not the correct syntax being it tells me getTimer is undeclared. How would I access the timer so I can stop it?</p>