Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嘿,我一直坚持如何将我的 int 值转换为 NSString 并获得正确的值
我有无符号整数
unsigned int r = 0xEFF;
我喜欢像@“EFF”这样的NSString,而不是@“3839”
您可以使用与 printf 相同的格式字符串:
NSString* newString = [NSString stringWithFormat:@"%x", r];