我要让其标签的文字时,我调用该方法“更新”将动态地改变为“下载”的UILabel:如何更改标签文本动态
self.checkingArray = [NSArray arrayWithObjects:@"download", @"download.", @"download..", @"download...",
nil];
- (void) updating
{
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(changeText) userInfo:nil repeats:YES];
}
- (void) changeText
{
checkLabel.text = [self.checkingArray objectAtIndex:curCheckingState];
self.curCheckingState++;
if (self.curCheckingState >= 4) {
self.curCheckingState = 0;
}
但标签文本留在文本“下载...“,我想知道如何达到我的目的?
尝试:'checkLabel.text = [self.checkingArray objectAtIndex:self.curCheckingState]' – Pfitz
增加0.5到2,看看标签是否变化也确保self.curCheckingState = 0 –
使用活动指标与uapatarance –