我有一个标签和一个由 10 个字符串值组成的数组。我知道如何在该标签中显示文本。但是现在,每 1 分钟我想显示该数组中的每个字符串到标签.知道怎么做吗?
最佳答案
使用 NSTimer
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:60.0 target:self selector:@selector(changeText:) userInfo:nil repeats:YES];
如果要停止计时器,请记住使用[timer invalidate]
,否则如果目标已被释放,您将崩溃。
关于iphone - 每 n 分钟在标签中显示 NSString,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10315038/