我正在使用下面的代码添加每 1.5 秒后创建的精灵,如下所示
[self schedule:@selector(addTraget:) interval:1.5];
-(void)addTraget:(ccTime)dt{
CCSprite *target = [CCSprite spriteWithFile:@"img1.png" rect:CGRectMake(0, 0, 80, 36)];
target.position = ccp(-target.contentSize.width/2, 100);
[self addChild:target];
target.tag = 1;
id actionMove = [CCMoveTo actionWithDuration:actualDuration*2.5 position:ccp(winSize.width + (target.contentSize.width/2), actualY)];
id actionMoveDone = [CCCallFuncN actionWithTarget:self selector:@selector(spriteMoveFinished:)];
id sequece = [CCSequence actions:delayTime1, calFun1, delayTime2, calFun2,actionMove, actionMoveDone, nil];
id repeate = [CCRepeatForever actionWithAction:sequece];
[target runAction:repeate];
}
由于 addTarget 方法已安排,那么在满足条件一段时间后如何停止此预定操作?