开发者

UILabel set dynamic Text including a long long

开发者 https://www.devze.com 2023-02-03 14:24 出处:网络
Hi i am trying to set a UILabeltext with the remaining KB Left from a NSURLConnection Download. NSString *left = (@\"Remaining: %lli KB\", (exceptedBytes-resourceLength)/1024);

Hi i am trying to set a UILabeltext with the remaining KB Left from a NSURLConnection Download.


NSString *left = (@"Remaining: %lli KB", (exceptedBytes-resourceLength)/1024);
[kbeleft setText:left];

But it does n开发者_运维技巧ot work. But when i am trying to use NSLog with

NSLog(@"Remaining: %lli KB", (exceptedBytes-resourceLength)/1024);

it works without any problems

what i am doing wrong?

kind regards


%lli isn't a valid String Format Specifier

Supported String Format Specifiers with stringWithFormat

http://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265-SW1


I'm pretty sure you need to use:

stringWithFormat:

From: http://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSString_Class/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号