Objective c 在UILabel中显示NSTimer计数
我希望显示要加载进程的倒计时,并了解不允许使用Objective c 在UILabel中显示NSTimer计数,objective-c,xcode4,nsstring,int,Objective C,Xcode4,Nsstring,Int,我希望显示要加载进程的倒计时,并了解不允许使用ARC将int转换为NSString。如何在NSString中显示我的计数 static int count = 0; count++; NSTimer *timer = [NSTimer scheduledTimerWithTimeInterval:(5.0) target:self selector:@selector(uploadDat
ARC
将int
转换为NSString
。如何在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;
}
static int count=0;
计数++;
NSTimer*定时器=[NSTimer scheduledTimerWithTimeInterval:(5.0)
目标:自我
选择器:@selector(上传数据)
用户信息:无
重复:否];
如果(计数可能最简单的方法是:
NSString* counter = [NSString stringWithFormat: @"%d", count];
可能最简单的方法是:
NSString* counter = [NSString stringWithFormat: @"%d", count];
您需要传入“count”,而不是“counter”。本可以为您编辑,但我不能编辑少于6个字符。:)您需要传入“count”,而不是“counter”。本可以为您编辑,但我不能编辑少于6个字符。:)谢谢我犯了一个典型的错误。我有这个,但在你发布后意识到我的版本有妄想症,这是不应该存在的。谢谢。我犯了一个典型的错误。我有这个,但在你发布我的版本后意识到我的版本有妄想症,这是不应该存在的。