views:

13

answers:

1

Althoug I read everywhere that the method signature has a BOOL for finished, I do never get a false. It is always true. And now the strange thing:

When I NSLog that out with %d, it is always either 32 or 40. Other BOOLs I have are either 1 or 0. That makes no sense. So: Not a bool, right?

What's that instead, really?

+3  A: 

The method signature for the did stop delegate selector is

- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context;

The finished parameter is an NSNumber that wraps up a boolean value. In Objective-C and other languages, any non-zero value is considered true (even negative numbers).

You can call [finished boolValue] on the NSNumber instance to get a true BOOL, YES or NO value.

The finished boolean value will be NO if the animation was cancelled or otherwise interrupted before completing it's full animation. If the animation ran through fully, then it will be YES.

From the docs:

finished

An NSNumber object containing a Boolean value. The value is YES if the animation ran to completion before it stopped or NO if it did not.

Jasarien