Iphone 需要帮助更改代码吗
我想将我的Iphone 需要帮助更改代码吗,iphone,xcode,Iphone,Xcode,我想将我的NSTimer代码更改为使用applicationsignificantimechange 这就是我现在拥有的 基本上我想更改计时器,而不是每5秒更改一次。例如,我希望这些文本标签在每晚12点更改。有人帮我吗 h文件 NSTimer *timer; IBOutlet UILabel *textLabel; m文件 - (void)onTimer { static int i = 0; if ( i == 0 ) { textLabel.text = @"iphone app"
NSTimer
代码更改为使用applicationsignificantimechange
这就是我现在拥有的
基本上我想更改计时器,而不是每5秒更改一次。例如,我希望这些文本标签在每晚12点更改。有人帮我吗
h文件
NSTimer *timer;
IBOutlet UILabel *textLabel;
m文件
- (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];
您是否检查了
initWithFireDate:interval:target:selector:userInfo:repeats:
NSTimer的方法?单击查看更多详细信息是的,但这并没有太大帮助。您可以向我解释一下吗?