UILabel set dynamic Text including a long long
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/
精彩评论