【发布时间】:2013-10-27 19:08:44
【问题描述】:
我正在尝试为项目启用 ARC,但在为 ARC 选择文件时遇到了一些问题。
在 Ball 类中,如下一行,
ballBody->SetUserData(self);
给出错误,
Cannot initialize a parameter of type 'void *' with an Ivalue of type 'Ball *const__strong'
在 Enemy.mm 类中,以下行,
enemyBody->SetUserData(enemySprite);
给出错误,
Cannot initialize a parameter of type 'void *' with an Ivalue of type 'CCPhysicsSprite*__strong'
在 Enemy.h 中,我将上述内容定义为:
b2Body* enemyBody;
CCPhysicsSprite* enemySprite; (in Enemy.m)
我该如何解决这些问题?
【问题讨论】:
标签: cocos2d-iphone automatic-ref-counting box2d-iphone