SIGABRT消息仅适用于iOS5
我正面临我的应用程序的一个奇怪的崩溃,只发生在iOS5。 这个问题似乎与我的核心animation方法bellow,因为当我没有设置值为aAnimation.repeatCount或0它正在工作,但是当它旋转我使用得到SIGABRT消息错误: – [NSConcreteValue doubleValue]:无法识别的select器发送实例0x9628100当我触摸设备/模拟器屏幕。
任何帮助将不胜感激
我的观点定义
- (void)loadView { CGRect screenRect = [[UIScreen mainScreen] applicationFrame]; UIView * contentView = [[UIView alloc] initWithFrame:screenRect]; contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.view = contentView; [contentView发布]; }
设置一个子视图
- (void)setUpPlacardView:(NSInteger)picture { //创build标牌视图 - 其init方法根据图像计算其框架 PlacardView * aPlacardView = [[PlacardView alloc] init:picture asColor:asColor]; aPlacardView.desaturation = kotucHue; self.placardView = aPlacardView; [aPlacardView发布]; [self.view addSubview:placardView]; }
子视图定义
@interface PlacardView:UIView { UIImage * placardImage; 浮动饱和度; UIColor * barva; BOOL switchMode; } @属性(非primefaces,保留)UIImage * placardImage; @property(非primefaces)float去饱和; @property(readwrite)BOOL switchMode; //初始化这个对象 - (id)init:(NSInteger)picture asColor:(BOOL)farba; @结束
并做旋转
- (void)makeKspinning { //创build一个在z轴上旋转的变换 浮动弧度= 3.120; CATransform3D转换; if(rotation){ transform = CATransform3DMakeRotation(radians,0.0,0.0,0.0); } 其他 transform = CATransform3DMakeRotation(radians,0.0,0.0,1.0); CABasicAnimation * aAnimation; aAnimation = [CABasicAnimation animationWithKeyPath:@“transform.rotation”]; CALayer * pLayer = placardView.layer; aAnimation.toValue = [NSValue valueWithCATransform3D:transform]; aAnimation.duration = spinSpeed; aAnimation.cumulative = YES; aAnimation.repeatCount = HUGE_VALF; [pLayer addAnimation:aAnimation forKey:@“animatePlacardViewToSpin”]; pLayer.opacity = spinOpacity; }
我认为问题是你将NSValue
设置为一个NSValue
,但关键path是transform.rotation
,它不是一个NSValue
。 你应该使用transform
作为你的keyPath,或者你应该使用transform.rotation.z
(或任何轴)作为keyPath,并使用一个简单的NSNumber
作为你的值。