Reputation: 1
I want to change my NSTimer
code to to use applicationSignificantTimeChange
This is what I have right now.
Basically I want to change the timer, instead of changing every 5 seconds for example I want these textLabels to change at 12am every night anyone help me out?
h file
NSTimer *timer;
IBOutlet UILabel *textLabel;
m file
- (void)onTimer {
static int i = 0;
if ( i == 0 ) {
textLabel.text = @"iphone app";
}
else if ( i == 1 ) {
textLabel.text = @" Great App!";
}
else if ( i == 2 ) {
textLabel.text = @" WOW!";
}
else {
textLabel.text = @" great application again!!";
i = -1;
}
i++;
}
timer =[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(onTimer) userInfo:nil repeats:YES];
Upvotes: 0
Views: 49