2012-07-20 51 views
1

我在iOS應用程序中創建了一些基本的動畫,它的表現完全正常......直到昨天。如何調試由UIKit的CoreAnimation調用觸發的崩潰?

我顯然做出了某種改變,以某種方式影響它,並且我很難確定問題是什麼。

當單步調試代碼,它得到這個塊的代碼,並且死步進在commitAnimation行之後(我最初寫這個之前,我認識的美女[UIView的animateWithDuration:...]:

UIView *favoritesTabItemView = [appDelegate.tabBarController.tabBar viewWithTag:0]; 
CGPoint startingPoint = [[magazineView superview] 
convertPoint:CGPointMake(magazineView.center.x, magazineView.center.y) toView:appDelegate.window.rootViewController.view]; 
CGPoint targetPoint = CGPointMake(favoritesTabItemView.center.x - 214.0, favoritesTabItemView.center.y); 

//shrink the icon down 
UIGraphicsBeginImageContextWithOptions(magazineView.bounds.size, NO, 0.0); 
[magazineView.layer renderInContext:UIGraphicsGetCurrentContext()]; 
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); 
UIGraphicsEndImageContext(); 

[UIImageView beginAnimations:nil context:nil]; 
[UIImageView setAnimationDuration:0.1]; 
PublicationCoverImageReflectionView.alpha = 0.0; 
[UIImageView commitAnimations]; //<-- crash happens after this line 

從後,我跨過commitAnimation調試器中的錯誤是給我什麼幫助?

*** Terminating app due to uncaught exception 'NSRangeException', reason: 
'*** -[__NSArrayM objectAtIndex:]: index 9 beyond bounds [0 .. 8]' 
*** First throw call stack: 
(0x35c8b88f 0x31604259 0x35bd49db 0x126d5d 0x12e65f 0x349da6c9 0x34a66531 0x35c57547 0x35be3097 0x349da3eb 0x307a3a13 0x10f8ef 0x35be53fd 0x307a9faf 0x307a9f6b 0x307a9f49 0x307a9cb9 0x307aa5f1 0x307a8ad3 0x307a84c1 0x3078e83d 0x3078e0e3 0x3596122b 0x35c5f523 0x35c5f4c5 0x35c5e313 0x35be14a5 0x35be136d 0x35960439 0x307bce7d 0xbb109 0xbb0c8) 
terminate called throwing an exception(lldb) 

有誰知道是什麼類型的數組這可能是說這是一個的UIKit調用,它的死亡時,所以我在想這個數組是一些vie的數組ws使用UIKit,但我沒有可見性...

任何想法如何解決甚至進一步調查這將是偉大的!

回答

0

嘗試切換到UIImageViewUIView

0

所以我想通了這個問題,並且它沒有直接關係CoreAnimation ...雖然這是的什麼是錯的症狀。

我一直在呼籲一些塊,我的調試設置無法找出它在哪裏崩潰。

我搜索了一些更多的調試幫助,最有幫助的問題是學習如何設置一個斷點,當發生異常時觸發。這幫助我確切地發現它發生的地方。它在塊內拋出異常,並且默認的調試器GUI沒有給出任何跡象......雖然在Xcode中使用控制檯也可以解決它。

爲所有異常設置一個斷點 - 非常有用!瞭解如何: "Run > Stop on Objective-C exception" in Xcode 4?

此外,檢查出這個線程一個不錯的方法添加到您的應用程序,以確保您始終獲得symbolicized堆棧跟蹤: Xcode 4.2 debug doesn't symbolicate stack call