The trick is you need to setAnimationDuration: (and all the other animation values) before you setAlpha:.
The behind-the-scenes animation setup gets created when you set the value being animated.
Also, what smasher was saying about the setAnimationDidStopSelector: is that UIView assumes a method signature identical to
Code:
- (void)animationDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context
which is to say you could call it:
Code:
- (void)x:(NSString *)id y:(NSNumber *)boolNumber z:(void *)nothing;
and still be in good programming style,
you obviously aren't using any of the parameters, so your callback will work,
the additional parameters are pushed onto the stack and ignored,
not guaranteed safe in all architectures of Objective-C, but okay on Intel and iPhone processors,
I would suggest something like:
Code:
[UIView setAnimationDidStopSelector:@selector(fadeInDidStop:finished:context:)];
- (void)fadeInDidStop:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context;