ARC semantic issue “multiple methods named 'setRotation' ” while archiving only

前端 未结 2 723
礼貌的吻别
礼貌的吻别 2021-01-06 05:58

My project in cocos2dv3 is throwing ARC Sematic Issue Multiple methods named \'setRotation:\' found with mismatched result, parameter type or attributes wh

相关标签:
2条回答
  • 2021-01-06 06:09

    update your cocos2dv3 to latest (RC4 for now).

    I was using Xcode 5.0 and cocos2dv3 RC1 with no problem. But updating Xcode to 5.1 I had this problem. So I updated the cocos2dv3 to RC4 and now it's working fine.

    You can find cocos 2d latest versions from here.

    0 讨论(0)
  • 2021-01-06 06:23

    This problem gave me a big headache. Though I've upgraded cocos2d to v2.2 version for my old project (too complex to update to v3), I still got this warning. And any animation I created use rotation in the SpriteBuilder does act oddly, as I described here: Rotation animation issue on iPhone5S with cocos2d 2.0

    Finally I used type casting to solve it as following in 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];
    }
    

    With this change, now I can support arm64 too.

    0 讨论(0)
提交回复
热议问题