我想显示我的倒计时加载过程,并了解使用ARC
将int
转换为NSString
是不允许的。如何在count
中显示我的NSString
?
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;
}
答案 0 :(得分:2)
最简单的方法可能是:
NSString* counter = [NSString stringWithFormat: @"%d", count];
答案 1 :(得分:1)
counterLabel.text = [NSString stringWithFormat:@"%d",count];