我用在IBAction为(按下按钮)方法的代码:只有在UIButton动画完成后才更新标签?
CABasicAnimation *rotateButton; //don't forget to release
rotateButton = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];
rotateButton.fromValue = [NSNumber numberWithFloat:0];
rotateButton.toValue = [NSNumber numberWithFloat:((720*M_PI)/180)];
rotateButton.duration = 0.75;
rotateButton.repeatCount = 1;
[sender addAnimation:rotateButton forKey:@"720"];
,并有我想只更新后,这是完整的一个标签。我想知道是否有一个简单的例子,任何人都可以提供给我,让标签只在完成时更新,而不是在方法完成时更新。我知道你不能使用“@selector(animationDidStop:finished:context :)”,因为苹果不喜欢它。任何人的帮助?谢谢,麻烦您了!
我去了底部的代码,因为我希望它是4倍前。不幸的是,我对此感到陌生,并且在CGAffineTransformMakeRotation行中出现错误:“请求成员”转换为“不是结构或联合的东西”....对于像我这样的白痴有什么想法? – BFBC 2011-04-17 00:30:23
Scratch ....我拼写错误... – BFBC 2011-04-17 03:33:17
btw ..我唯一可以让@selector工作在多个按钮上并正确使用setAnimationDidStop @选择器的方法是使用[UIView setAnimationDelegate:self]行[UIView commit动画] – BFBC 2011-04-17 05:16:35