title: Invalidating a NSTimer from within its invocation method
body: <p>I have scheduled a timer using [NSTimer scheduledTimerWithTimeInterval:target:selector:userInfo:] and want to invalidate it at some point when it fires.</p>
  
  <pre><code>- (id)init
  {
      [NSTimer scheduledTimerWithInterval:1 target:self selector:@selector(fired:) userInfo:nil repeats:YES];
  }
  
  - (void)fired:(NSTimer *)timer
  {
      if (someCondition) {
          [timer invalidate];
      }
  }
  </code></pre>
  
  <p>Is this allowed? The documentation states</p>
  
  <blockquote>
    <p>You must send this message from the thread on which the timer was installed. If you send this message from another thread, the input source associated with the timer may not be removed from its run loop, which could prevent the thread from exiting properly.</p>
  </blockquote>
  
  <p>If this is not a proper way to accomplish this task: What is the proper way?</p>