Cocos2d iphone Cocos2d无符号整数显示在所有位置

Cocos2d iphone Cocos2d无符号整数显示在所有位置,cocos2d-iphone,updates,unsigned-integer,Cocos2d Iphone,Updates,Unsigned Integer,我不知道我做了什么-我正在愉快地编写代码。。我认为这可能与将Xcode更新为4.1.1有关,但突然,当我构建并运行我的项目时,以下编译器警告出现在大约20个不同的cocos2d模块中 'format指定无符号int,但参数有['CCTimer'](或它所在的任何模块) cocos2d模块中有问题的行是: return [NSString stringWithFormat:@"<%@ = %08X | target:%@ selector:(%@)>", [self class], s

我不知道我做了什么-我正在愉快地编写代码。。我认为这可能与将Xcode更新为4.1.1有关,但突然,当我构建并运行我的项目时,以下编译器警告出现在大约20个不同的cocos2d模块中

'format指定无符号int,但参数有['CCTimer'](或它所在的任何模块)

cocos2d模块中有问题的行是:

return [NSString stringWithFormat:@"<%@ = %08X | target:%@ selector:(%@)>", [self class], self, [target class], NSStringFromSelector(selector)];
返回[NSString stringWithFormat:@“,[self class],self,[target class],NSStringFromSelector(选择器)];
是“%08X”导致了这个问题

由于这个错误,我无法在iphone上编译,尽管它在模拟器中运行良好。我将手机操作系统更新为最新版本,但没有任何帮助


还有其他人有这个吗?

这是cocos2d中试图打印指针值的许多格式字符串之一。当%08X工作时,正确的方法是使用%p。因此,您可以将该行更改为:

[NSString stringWithFormat:@"<%@ = %p | target:%@ selector:(%@)>", [self class], self, [target class], NSStringFromSelector(selector)];

PS:我最近修复了所有这些不正确的cocos2d登录。

谢谢!顺便说一句,这本书很棒!您可能已在kobold中修复,但忘记在初学者工具包中修复:/
%08X: 0976DC80
%p:   0x976dc80