Call method with parameters after animation completion

Posted by Jean on Stack Overflow See other posts from Stack Overflow or by Jean
Published on 2010-03-08T00:52:49Z Indexed on 2010/03/08 1:01 UTC
Read the original article Hit count: 301

Filed under:
|
|

I want to call a method with certain parameters once an animation is done.

The flow is something like this:

-(void) myMethod:(int)val
{
    [self performAnimation];
    [self doSomethingElse:val]; // This should be done after animation completion
}

I presume the 'doSomethingElse' method needs to be called from the method defined in 'setAnimationDidStopSelector' - or is there a way to have the animation block until done?

What is the best way to let the method called on 'setAnimationDidStopSelector' know about the method it needs to call and its parameter? Can this be done with selectors? Or is the only way of doing this by storing the methods and its params in class temp variables and access them when needed?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch