@interface MyViewController () {
NSTimer *timer;
int seconds;
...
}
@property (weak, nonatomic) IBOutlet UILabel *timerLabel;
@end
...
- (void)viewDidLoad
{
[super viewDidLoad];
timer = [NSTimer scheduledTimerWithTimeInterval:1.0f target:self selector:@selector(updateTimer:) userInfo:nil repeats:YES];
seconds = 0;
}
- (void)updateTimer:(NSTimer *)theTimer {
[functions playSound:[NSString stringWithFormat:@"%@",seconds] ofType:@"aac"];
seconds++;
}