我有以下声明:
NSLog(@"The count of the book is now: %i", [book.book count]);
这给了我一个警告,那就是我使用了错误的格式参数。
您可以但可能不应该将其打印为有符号整数,因为它可能包含会使有符号整数溢出的值。另外,根据平台是32位还是64位,NSUInteger可以定义为unsigned int或unsigned long,因此您可以通过将其强制转换为unsigned long,然后使用unsigned long格式说明符来进行处理。
NSLog(@"The count of the book is now: %lu", (unsigned long)[book.book count]);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句