My project in cocos2dv3 throws an ARC Sematic Issue
Several methods called "setRotation:" were found with inconsistent result, parameter type or attributes during archiving (release mode). It works great when deployed to a simulator / device (debug mode). In release mode, the compiler gets confused between the implementation of rotation in UIRotationGestureRecognizerand CCNode. When I got the error in CCBAnimationManager.m, I came up with an object that calls the setRotation ( CCNode*) selector , but then the error crept in CCActionInterval. I hope cocos2d library has a better solution than type casting.
What am I doing wrong? Thank you for your time.
EDIT
@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;
at
CCAction.m
@synthesize tag = _tag, target = _target, originalTarget = _originalTarget;
-(void) startWithTarget:(id)aTarget
{
_originalTarget = _target = aTarget;
}
-(void) startWithTarget:(id)aTarget
{
_originalTarget = _target = aTarget;
}
Class hierarchy
@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];
}
}
source
share