我必须升级我的部署目标,现在我在记录枚举值时遇到一些错误。
NSLog(@"Warning: unexpected unit :%d", unit);生成以下错误:
Format specifies for type 'int' but the argument has type 'NSCalendarUnit' (aka 'enum NSCalendarUnit')建议的修复方法是先使用%lu,然后使用%u,这会产生类似的错误。
发布于 2014-01-04 02:09:21
只需将枚举值转换为(int):
NSLog(@"Warning: unexpected unit :%d", (int)unit);https://stackoverflow.com/questions/20909970
复制相似问题