我正面臨着我的應用程序的一個奇怪的崩潰,只發生在iOS5上。這個問題似乎與我的核心動畫方法bellow,因爲當我沒有爲aAnimation.repeatCount或0設置值它正在工作,但是當它旋轉我使用獲取SIGABRT消息與錯誤: - [NSConcreteValue doubleValue]:無法識別的選擇器發送到實例0x9628100當我觸摸設備/模擬器屏幕。僅適用於iOS5的SIGABRT消息
任何幫助將不勝感激
我的觀點定義
- (void)loadView { CGRect screenRect = [[UIScreen mainScreen] applicationFrame]; UIView *contentView = [[UIView alloc] initWithFrame:screenRect]; contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.view = contentView; [contentView release]; }
設置子視圖
- (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]; }
子視圖定義
@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; }
這將有助於,如果你說什麼線它崩潰。 –
它實際上指向「int retVal = UIApplicationMain(argc,argv,nil,@」AppDelegate「);」在我的main.m – Vanya
這只是具有源代碼的頂級框架。回溯會顯示一堆OS功能,我打賭你會發現它在CoreAnimation的中間,試圖訪問動畫對象。 –