title: Best Practice: How to update a repeating NSTimer interval after each call to the selector method
body: <p>I have an <code>NSTimer</code> object that I need to repeatedly execute.  The code that it calls is ultimately toggles a setting in my application through 4 various states.  Each time the state changes, I want my interval to change on my timer.  This loop should continue throughout the lifetime of the application.  </p>
  
  <p>As far as I can tell, you can not update the <code>interval</code> property on an <code>NSTimer</code>.  I believe this means that I need to add code to create a new <code>NSTimer</code> object each time I toggle my state within my timer code.  The following implementation is what I am thinking:</p>
  
  <pre><code>//Consider that in my containing class, there is an NSTimer property, named myTimer.
  
  //My selector method, used by myTimer
  -(void) updateState:(NSTimer *) timer
  {
      switch (AppState)
      {
      case state_1:
          //Update current state to state_2
          [self setMyTimer:[NSTimer scheduledTimerWithTimeInterval:30.0 
                                                            target:self 
                                                          selector:@selector(updateState:) 
                                              userInfo:nil repeats:NO];
          break;
      case state_2:
          //Update current state to state_3
          [self setMyTimer:[NSTimer scheduledTimerWithTimeInterval:5.0 
                                                            target:self 
                                                          selector:@selector(updateState:) 
                                              userInfo:nil repeats:NO];
          break;
      case state_3:
          //Update current state to state_4
          [self setMyTimer:[NSTimer scheduledTimerWithTimeInterval:30.0 
                                                            target:self 
                                                          selector:@selector(updateState:) 
                                              userInfo:nil repeats:NO];
          break;
      case state_4:
          //Update current state back to state_1
          [self setMyTimer:[NSTimer scheduledTimerWithTimeInterval:5.0 
                                                            target:self 
                                                          selector:@selector(updateState:) 
                                              userInfo:nil repeats:NO];
          break;
      }
  }
  </code></pre>
  
  <p>Is this the most optimal solution or can the creation of all these timers cause any form trouble for my application as it continuously executes?  </p>
  
  <p>Also, I have ARC cut on within my project.  In this case, will I still need to destroy the previous <code>NSTimer</code> objects?</p>