tags:

views:

991

answers:

1

Hi

I am using the following code for calling a method once my animation stops

[UIView beginAnimations:@"swipe" context:NULL];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(transitionDidStop:finished:context:)];
[UIView setAnimationDuration:0.3f];

//My Animation

[UIView commitAnimations];

And this is the signature of the transitionDidStop method

- (void)transitionDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context

But I noticed that the method is never called even after the transition stops. Why is that?

Thanks.

+1  A: 

Because you need

- (void)transitionDidStop:(NSString *)animationID finished:(BOOL)finished context:(void *)context

method

But you have

- (void)transitionDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
oxigen
It works. Thanks. I saw the MoveMe sample for the method usage and that specifies the second argument as an NSNumber. Strange. Thanks again
lostInTransit
Bugs? In Apple code? Never!
Roger Nolan
In apple code it works with NSNumber))But in documentation:http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/clm/UIView/setAnimationDidStopSelector.....The selector should have the following method signature: animationFinished:(NSString *)animationID finished:(BOOL)finished context:(void *)context.
oxigen