title: NSTimer Not Stopping When Invalidated
body: <p>I have the following code in my .h file:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import &lt;CoreLocation/CoreLocation.h&gt;
  #import &lt;AVFoundation/AVFoundation.h&gt;
  #import &lt;MapKit/MapKit.h&gt;
  
  @interface LandingController : UIViewController&lt;CLLocationManagerDelegate&gt; {
      CLLocationManager *LocationManager;
      AVAudioPlayer *audioPlayer;
  
  }
  
  @property (nonatomic, retain) NSTimer *messageTimer;
  
  - (IBAction)LoginButton:(id)sender;
  
  @end
  </code></pre>
  
  <p>I have the following code in my .m file:</p>
  
  <pre><code>@interface LandingController ()
  
  @end
  
  @implementation LandingController
  @synthesize messageTimer;
  
  - (void)checkForMessages
  {
  
      UIAlertView *alert = [[UIAlertView alloc]
                            initWithTitle:@"BINGO:"
                            message:@"Bingo This Works"
                            delegate:nil
                            cancelButtonTitle:@"Okay"
                            otherButtonTitles:nil];
  
      [alert show];
  
  }
  
  - (IBAction)LoginButton:(id)sender {
  
      if ([UserType isEqualToString:@"Owner"]) {
  
          if (messageTimer){ 
          [self.messageTimer invalidate];
          self.messageTimer = nil;
          }
  
      } else {
  
          if (!messageTimer){
  
             self.messageTimer = [NSTimer scheduledTimerWithTimeInterval:10.0
                                                               target:self
                                      selector:@selector(checkForMessages)
                                                             userInfo:nil
                                                              repeats:YES];
  
  
          }
      }
  
  }
  
  @end
  </code></pre>
  
  <p>But my timer doesn't want to stop when I call the invalidate.</p>
  
  <p>The LoginButton is only pressed twice, once when the strResult is = to "Guard" and then the application changes it to be equal to "Owner" and the user presses the login button again, so I don't think I'm setting multiple timers.  </p>
  
  <p>After pressing the login button and starting the timer I segue to another view and then segue back to press the login button once more which is when I want the timer to stop.  Do I need to do anything special to get the messageTimer since I switched views for a moment and then came back?  </p>
  
  <p>Any ideas?</p>
  
  <p>Thanks!</p>