can not stop NSTimer
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1031554/nstimer-doesnt-stop">NSTimer doesn&#39;t stop</a>  </p>
</blockquote>



<p>I hope to stop a running NSTimer, below are my codes:</p>

<pre><code>timer=[[NSTimer scheduledTimerWithTimeInterval:10       
       target:self
     selector:@selector(timerFired:)
     userInfo:nil
      repeats:NO] retain];
</code></pre>

<p>the function that stops the timer</p>

<pre><code>-(void)stopTimer;
{

  [timer invalidate];
  [timer release];
   timer = nil;

}
</code></pre>

<p>But I found that even I called 'stopTimer', the timer did not stop and 'timerFired' would be triggered.</p>

<p>Welcome any comment</p>

<p>Thanks</p>

<p>interdev</p>
