由于这个原因,应用程序崩溃 -[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;
}
Run Code Online (Sandbox Code Playgroud)