ARC语义问题“多个方法命名为”setRotation“”而仅存档

我在cocos2dv3中的项目抛出了ARC Sematic发行在归档(发布模式)时发现了多个名为“setRotation:”的方法,结果不匹配,参数types或属性不匹配。 在部署到模拟器/设备(debugging模式)时运行良好。 在发布模式下,编译器会在UIRotationGestureRecognizerCCNode的旋转实现之间混淆。 当我在CCBAnimationManager.m得到错误时,我调用了将select器setRotation调用为( CCNode *)的对象,但是随后在CCActionInterval出现错误。 我希望有比cocos2d库中的任何地方都更好的解决scheme。

我究竟做错了什么? 感谢您的时间。

编辑

 @interface CCAction : NSObject <NSCopying> { id __unsafe_unretained _originalTarget; id __unsafe_unretained _target; NSInteger _tag; } @property (nonatomic,readonly,unsafe_unretained) id target; @property (nonatomic,readonly,unsafe_unretained) id originalTarget; @property (nonatomic,readwrite,assign) NSInteger tag; 

 CCAction.m @synthesize tag = _tag, target = _target, originalTarget = _originalTarget; -(void) startWithTarget:(id)aTarget { _originalTarget = _target = aTarget; } -(void) startWithTarget:(id)aTarget { _originalTarget = _target = aTarget; } 

类层次结构

 @interface CCActionFiniteTime : CCAction <NSCopying> @interface CCActionInterval: CCActionFiniteTime <NSCopying> @interface CCBRotateTo : CCActionInterval <NSCopying> CCBRotateTo.m { -(void) startWithTarget:(CCNode *)aTarget { [super startWithTarget:aTarget]; startAngle_ = [self.target rotation]; diffAngle_ = dstAngle_ - startAngle_; } -(void) update: (CCTime) t { [self.target setRotation: startAngle_ + diffAngle_ * t]; } } 

这个问题让我头痛不已。 虽然我已经将cocos2d升级到了我的旧项目的v2.2版本(太复杂了,不能更新到v3),但是我仍然得到了这个警告。 我创build的任何animation在SpriteBuilder中使用旋转都会有奇怪的现象,正如我在这里所描述的: 使用cocos2d 2.0的iPhone5S上的旋转animation问题

最后,我使用types转换来解决它,如下CCBAnimationManager.m

 @implementation CCBRotateTo -(void)startWithTarget:(CCNode *)aTarget { [super startWithTarget:aTarget]; starAngle_ = [(CCNode *)self.target rotation]; diffAngle_ = dstAngle_ - startAngle_; } -(void)update:(ccTime)t { [(CCNode *)self.target setRotation: startAngle_ + diffAngle_ * t]; } 

有了这个改变,现在我也可以支持arm64了。

更新你的cocos2dv3到最新的版本(RC4)。

我正在使用Xcode 5.0和cocos2dv3 RC1没有问题。 但更新Xcode到5.1我有这个问题。 所以我更新了Cocos2dv3到RC4,现在工作正常。

你可以从这里findcocos 2d的最新版本。