Hi!. I'm trying to learn CAAnimation, and am having some trouble. I have searched all over the place for tutorials on it and how to use it for the past 2 days, have had little to no success. Here's some code I have found, but when I try to use it, it doesn't work. Can you tell me what's wrong?
BTW, I am trying to do this to a UIImageView.
CABasicAnimation *theAnimation;
theAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.duration=3.0;
theAnimation.repeatCount=2;
theAnimation.autoreverses=YES;
theAnimation.fromValue = [NSNumber numberWithFloat:1.0];
theAnimation.toValue = [NSNumber numberWithFloat:.2];
[[self layer] addAnimation:theAnimation forKey:@"animateOpacity"];
[[self layer] animationForKey:@"animateOpacity"];
This "should" make it flicker, but it doesn't.
Also, do you know how I would use CAAnimation to move an object to a point? I really need your help! Thanks in advance!