Since no one wanted to answer this and assumed that you hadn't solved it yet, I thought I'd give him bash.
First, I would create a property that stores the state of the animation. i.e
NSUIneteger animationState;
: 0 = idleState; 1 = startState; 2 = loopedState; 3 = endState;
BOOL , ;
BOOL haltAnimation;
State 0. , CAAnimation , . haltAnimation false;
animationDidStart ( ) - :
-(void)animationDidStart {
switch(animationState) {
case 0:
animationState = 1;
break;
case 1:
animationState = 2;
break;
case 2:
if(haltAnimation)
animationState = 3;
}
}
- :
-(void)animationDidFinish {
swtich(animationState) {
case 1:
break;
case 2:
if(!haltAnimation) {
} else {
}
break;
case 3:
animationState = 0;
break;
}
}
, , 2 , haltAnimation true.
, . - .