create a countdown timer in objective c (iPhone development) [duplicate]

- (IBAction)buttonPressed:(id)sender
{
    [NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(timerExpired) userInfo:nil repeats:NO];
}

- (void)timerExpired
{
    NSLog(@"Your two seconds are up!");
}

Leave a Comment