I’m trying to do something like:
<Create a CAAnimationGroup aGroup with removedOnCompletion = NO ...>
[aLayer addAnimation:aGroup forKey:@"someKey"];
So the animation group plays…
And then I’d want to retrieve the same animation group without recreating it and re-add it to the layer so that it replays. Something like:
CAAnimationGroup* theOldGroup = (CAAnimationGroup*)[aLayer animationForKey:@"someKey"];
[aLayer addAnimation:theOldGroup forKey:@"someKey"];
However, the address of aGroup is different than the one I get back from animationForKey. And trying to set its speed to 1 or doing anything with it crashes the app (aka BAD_ACCESS)
What am I missing?
No, you can’t reuse them the way you are describing in your question.
The documentation for
animationForKey:says you can’t do it this way (in the discussion):