由于此原因应用程序崩溃 -[NSConcreteValue doubleValue]: unrecognized selector sent to
我的项目中使用了以下代码,我进行了很多搜索,我得到了转换的原因,但是如果我将 transform.scale 替换为它,那么动画就会改变 帮帮我!
[viewContent.layer addAnimation:[self getShakeAnimation] forKey:@"transform.scale"];
- (CAAnimation*)getShakeAnimation
{
CAKeyframeAnimation *animation = [CAKeyframeAnimation animation];
animation.values = [NSArray arrayWithObjects:
[NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI_2, 0.0f, 1.0f, 0.0f)],
[NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 0.0f, 0.0f, 0.0f)],
[NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI * 2, 0.0f, 1.0f, 0.0f)],nil];
animation.duration = 0.8f;
animation.delegate = self;
return animation;
}
最佳答案
您正在为键路径transform.scale
(一个float
)添加动画,但正在传入CATransform3D
。您需要更正您的键路径或您的输入。
关于iphone - 关键帧动画期间应用程序崩溃 : -[NSConcreteValue doubleValue] unrecognized selector,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12684849/