title: UILabel Not Updating When Returning to UIViewController
body: <p>I have a simple app that has an NSTimer object in the appDelegate to be accessed by all views. The structure of the app is with a UINavigationController. When I fire the NSTimer object, my UILabel is being updated with the correct countdown function, but when I go back to the rootViewController and back to the countdown timer view, my UILabel is being updated with the current countdown time, but no subsequent updates to the UILabel happen. What am I missing? I have done research on making sure the UILabel object is not nil, that I call the function on the viewDidAppear method, and nothing seems to work! Here is the code:</p>
  
  <h2>AppDelegate.h</h2>
  
  <pre><code>@interface AppDelegate : UIResponder &lt;UIApplicationDelegate&gt; {
  }
  @property (nonatomic, retain) NSTimer *countdownTimer;
  </code></pre>
  
  <h2>AppDelegate.m</h2>
  
  <pre><code>@implementation AppDelegate
  
  @synthesize countdownTimer;
  </code></pre>
  
  <h2>CountdownTimerViewController.h</h2>
  
  <pre><code>#import "AppDelegate.h"
  enter code here
  @interface CountdownTimerViewController : UIViewController {
  enter code here
  AppDelegate *appdelegate;
  
  }
  
  @property (strong, nonatomic) IBOutlet UILabel *labelCountdownTimer;
  @property (strong, nonatomic) IBOutlet UIButton *buttonStartTimer;
  @property (strong, nonatomic) IBOutlet UIButton *buttonStopTimer;
  
  - (IBAction)startTimer:(id)sender;
  - (IBAction)stopTimer:(id)sender;
  </code></pre>
  
  <h2>CountdownTimerViewController.m</h2>
  
  <pre><code>@implementation CountdownTimerViewController
  
  @synthesize labelCountdownTimer;
  
  - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
      if (self) {
          // Custom initialization
      }
      return self;
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view.
  
      //Instatiating Appdelegate
      if(!appdelegate)
          appdelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  
  }
  
  - (void) viewDidAppear:(BOOL)animated {
  
      if ([appdelegate.countdownTimer isValid]) {
          [self countDown];
      }
  
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  #pragma mark - Button Action Methods
  
  - (IBAction)startTimer:(id)sender {
  
      [self updateCounter];
  
  }
  
  - (IBAction)stopTimer:(id)sender {
  
      [appdelegate.countdownTimer invalidate];
      labelCountdownTimer.text = @"00:00:00";
  
  }
  
  int countLimit=30; //seconds
  NSDate *startDate;
  
  - (void)countDown {
  
      if([[NSDate date] timeIntervalSinceDate:startDate] &gt;= countLimit) {
          [appdelegate.countdownTimer invalidate];
          return;
      }
      else {            
      NSDate *currentDate = [NSDate date];
      NSTimeInterval timeInterval = -([currentDate timeIntervalSinceDate:startDate]);
      NSDate *timerDate = [NSDate dateWithTimeIntervalSince1970:timeInterval];
      NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
      [dateFormatter setDateFormat:@"mm:ss"];
      [dateFormatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0.0]];
      NSString *timeString = [dateFormatter stringFromDate:timerDate];
          NSLog(@"timeString: %@",timeString);
          NSLog(@"labelCountdownTimer: %@",labelCountdownTimer);
      labelCountdownTimer.text = timeString;
      }
  
  }
  
  - (void)updateCounter {
  
      labelCountdownTimer.text = @"00:00:00";
      startDate = [NSDate date];
  
      appdelegate.countdownTimer = [NSTimer scheduledTimerWithTimeInterval:1.0/10.0
                                                                    target:self
                                                                  selector:@selector(countDown)
                                                                  userInfo:nil
                                                                   repeats:YES];
  
  }
  </code></pre>