【发布时间】:2011-12-09 21:41:08
【问题描述】:
我的应用程序发生了奇怪的崩溃,该崩溃仅在 iOS5 中发生。问题似乎出在下面的核心动画方法上,因为当我没有为 aAnimation.repeatCount 或 0 设置任何值时,它正在工作,但是当它旋转时,我使用 get SIGABRT message with error: -[NSConcreteValue doubleValue]: unrecognized selector sent to当我触摸设备/模拟器屏幕时,实例为 0x9628100。
任何帮助将不胜感激
我的视图定义
-(无效)加载视图{ CGRect screenRect = [[UIScreen mainScreen] applicationFrame]; UIView *contentView = [[UIView alloc] initWithFrame:screenRect]; contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.view = contentView; [内容视图发布]; }设置子视图
- (void)setUpPlacardView:(NSInteger)picture { // 创建标语牌视图——它的 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 开关模式; } @property (nonatomic, 保留) UIImage *placardImage; @property(非原子)浮点去饱和; @property (readwrite) BOOL switchMode; // 这个对象的初始化器 - (id)init:(NSInteger)图片asColor:(BOOL)farba; @结尾旋转
- (void)makeKspinning { // 创建一个在 z 轴上旋转的变换 浮动弧度 = 3.120; CATransform3D变换; 如果(旋转){ 变换 = CATransform3DMakeRotation(弧度, 0.0, 0.0, 0.0); } 别的 变换 = CATransform3DMakeRotation(弧度, 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; }【问题讨论】:
-
如果你说它在哪一行崩溃会有所帮助。
-
它实际上指向行“int retVal = UIApplicationMain(argc, argv, nil, @"AppDelegate");"在我的 main.m
-
这只是有源的顶部框架。回溯将显示一堆操作系统函数,我敢打赌你会发现它在 CoreAnimation 的中间,试图访问动画对象。
-
我和你有同样的问题。 iOS 5 特有的崩溃。
标签: ios uiview crash core-animation ios5