- 比如要将CATransform3DMakeRotation(M_PI, 1, 1, 0)这个结构体转为对象,这个时候就要用到
NSValue
对象了
NSValue *value = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 1, 1, 0)];
[self.view.layer setValue:value forKeyPath:@"transform.rotation.x"];
NSValue
对象了 NSValue *value = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI, 1, 1, 0)];
[self.view.layer setValue:value forKeyPath:@"transform.rotation.x"];