title: How to know when to invalidate an `NSTimer`
body: <p>Here's my issue:</p>
  
  <p>I have a model class that has an <code>NSTimer</code> in it that I want the Timer to run for the entire lifespan of the model object.  Initiliazation is easy:  I just have the following line of code in the <code>init</code> method:</p>
  
  <pre><code>self.maintainConnectionTimer = 
               [NSTimer scheduledTimerWithTimeInterval:1 
                                                target:self 
                                              selector:@selector(maintainConnection) 
                                              userInfo:nil 
                                               repeats:YES];
  </code></pre>
  
  <p>However, my issue is, <strong>how do I invalidate this timer when the model is released from memory?</strong>  Now, this would usually be easy, however, as far as I know, when you schedule an <code>NSTimer</code> the OS maintains a strong pointer to the Timer object.  </p>
  
  <p>How should I deal with this? Is there a method that gets called right before the model is released from memory?</p>