我得到的控制台消息内调用外部方法:NSInvalidArgumentException当我试图从另一个方法
2011-10-05 17:21:15.112 Fairstead[4986:207] -[CCSprite translate::::]: unrecognized selector sent to instance 0x546fdb0
2011-10-05 17:21:15.116 Fairstead[4986:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CCSprite translate::::]: unrecognized selector sent to instance 0x546fdb0'
-(void)ccTouchEnded:(UITouch *)touch withEvent:(UIEvent *)event
{
CGPoint touchLocation = [touch locationInView: [touch view]];
touchLocation = [[CCDirector sharedDirector]convertToGL:touchLocation];
touchLocation = [self convertToNodeSpace:touchLocation];
[pc translate:300.0 :touchLocation :pc.position :pc]; //crash on this line
}
这里是翻译方法:
-(void) translate:(float) objectVelocity: (CGPoint) translateLocation: (CGPoint) objectLocation:(DefaultObject *) sender
{
CGPoint moveDifference = ccpSub(translateLocation, objectLocation);
float distanceToMove = ccpLength(moveDifference);
float moveDuration = distanceToMove/objectVelocity;
[sender runAction:[CCMoveTo actionWithDuration:moveDuration position:translateLocation]];
}
的触摸结束的方法是不同的类文件比翻译。
的翻译方法是在DefaultObject类文件,它是一个子类CCSprite的
电脑合成和@property是非原子,保留
我缺少什么?