我想顯示我要加載的進程的倒計時,並瞭解它不允許使用ARC
將int
轉換爲NSString
。如何在NSString
內顯示我的count
?在UILabel中顯示NSTimer計數
static int count = 0;
count++;
NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:(5.0)
target:self
selector:@selector(uploadData)
userInfo:nil
repeats:NO];
if (count <= 5)
{
ilabel.text = @"Please be patient...";
NSString *counter = count;
counterLabel.text = counter;
}
謝謝。我犯了一個典型的錯誤。我有這個,但是在你發佈之後,我意識到我的版本有不適宜的版本。 – Greg 2013-03-16 18:57:20
不客氣。我也犯了這些錯誤。 – hvanbrug 2013-03-16 19:04:54