我要讓其標籤的文字時,我調用該方法「更新」將動態地改變爲「下載」的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 –