title: Implementing a Countdown Timer in Objective-c?
body: <p>I am new to iOS programming. I am working on words matching game. In this game I need to implement time counter which shows minutes and seconds. I want when my game is started my timer to start with 3 minutes. Now I want to decrease this timer in reverse direction with seconds. my code just work for seconds..here is my code:</p>
  
  <pre><code>  secondsLeft--;
  
    int seconds = (secondsLeft %3600) % 60;
  
    Timerlbl.text = [NSString stringWithFormat:@"%02d",seconds];
  
  
    if (seconds==0)
  
  {
  
  
   UIAlertView *pAlert = [[UIAlertView alloc]initWithTitle:@"Sorry!!"   
   message:@"TimeOver"        delegate:self    cancelButtonTitle:@"OK"   
   otherButtonTitles:@"Cancel",nil];
  
   [pAlert show];
  
  [pAlert release];
  
   }
  
   }
  </code></pre>
  
  <p>In Viewdidload i call it through timer..</p>
  
  <pre><code>          countDown=[NSTimer scheduledTimerWithTimeInterval:5.0 target:self 
                   selector:@selector(TimeOver) userInfo:nil repeats:YES];
  </code></pre>
  
  <p>pleas any one guide me how can i do it in both minutes and seconds.</p>