iphone - Why is animationDidStart called after removeAllAnimations is called? -
in animationdidstart
(cabasicanimation
delegate), want update catextlayer
. however, if user touches screen, want remove animations going on [self.masklayer removeallanimations];
(all animations played sequentially).
however, after removeallanimations
, somehow, animationdidstart
, animationdidstop
still called, animation not shown. not want, obviously.
the animations added follows:
- (void)addanimations { (int i=1; i<6; i++) { nsstring* intvalue = [nsstring stringwithformat:@"%d", i]; cabasicanimation *animation = [cabasicanimation animationwithkeypath:@"path"]; animation.duration = 0.5; animation.delegate = self; animation.repeatcount = 0; animation.autoreverses = no; [animation setvalue:intvalue forkey:@"animationstring"]; animation.timingfunction = nil; [animation setremovedoncompletion:no]; [animation setfillmode:kcafillmodeforwards]; animation.fromvalue = (id) [self getcgrectforzoomlevel:i]; animation.tovalue = (id) [self getcgrectforzoomlevel:i + 1 ]; animation.begintime = cacurrentmediatime() + * 2; [self.shapelayer addanimation:animation forkey:intvalue]; } }
how prevent this? issue has taken me several hours :(
thanks!
Comments
Post a Comment