gpt4 book ai didi

ios - 仅适用于 iOS5 的 SIGABRT 消息

转载 作者:可可西里 更新时间:2023-11-01 05:47:45 24 4
gpt4 key购买 nike

我的应用程序发生奇怪的崩溃,这种崩溃只发生在 iOS5 上。问题似乎出在我下面的核心动画方法上,因为当我没有为 aAnimation.repeatCount 或 0 设置任何值时它正在工作,但是当它旋转时我使用 get SIGABRT message with error: -[NSConcreteValue doubleValue]: unrecognized selector sent to当我触摸设备/模拟器屏幕时实例 0x9628100。

任何帮助将不胜感激

我的 View 定义

- (void)loadView {    CGRect screenRect = [[UIScreen mainScreen] applicationFrame];    UIView  *contentView = [[UIView alloc] initWithFrame:screenRect];    contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;    self.view = contentView;    [contentView release];}

设置 subview

- (void)setUpPlacardView:(NSInteger)picture {    // Create the placard view -- its init method calculates its frame based on its image    PlacardView *aPlacardView = [[PlacardView alloc] init:picture asColor:asColor];    aPlacardView.desaturation = kotucHue;    self.placardView = aPlacardView;    [aPlacardView release];    [self.view addSubview:placardView];}

subview 定义

@interface PlacardView : UIView {    UIImage                 *placardImage;    float                   saturation;    UIColor                 *barva;    BOOL                    switchMode;}@property (nonatomic, retain) UIImage *placardImage;@property (nonatomic)       float     desaturation;@property (readwrite) BOOL              switchMode;// Initializer for this object- (id)init:(NSInteger)picture asColor:(BOOL)farba;@end

并进行旋转

- (void)makeKspinning{    // Create a transform to rotate in the z-axis    float radians = 3.120;       CATransform3D transform;    if (rotation) {        transform = CATransform3DMakeRotation(radians, 0.0, 0.0, 0.0);    }    else        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;}

最佳答案

我认为问题在于您将 toValue 设置为 NSValue,但关键路径是 transform.rotation,它是不是 NSValue。您应该使用 transform 作为您的 keyPath,或者您应该使用 transform.rotation.z (或任何轴)作为 keyPath 和一个简单的 NSNumber 作为你的值(value)。

关于ios - 仅适用于 iOS5 的 SIGABRT 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7804404/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com