2013-05-10 36 views
2

當我正在更改設備方向時,我正在與正在使用的應用程序發生異常終止(崩潰)。我無法經常複製它(當我旋轉時不會總是發生這種情況,假設機會在0.01%左右),但這是一個嚴重的問題。我附上了崩潰報告的重要部分。iOS中的自轉運行崩潰

Exception Type: EXC_BAD_ACCESS (SIGSEGV) 
Exception Codes: KERN_INVALID_ADDRESS at 0x6563616e 
Crashed Thread: 0 

Thread 0 name: Dispatch queue: com.apple.main-thread 
Thread 0 Crashed: 
0 libobjc.A.dylib     0x3233a5b0 objc_msgSend + 16 
1 UIKit       0x36297b82 -[UISectionRowData  refreshWithSection:tableView:tableViewRowData:] + 1546 
2 UIKit       0x3628301e -[UITableViewRowData  rectForFooterInSection:] + 310 
3 UIKit       0x3628358c -[UITableViewRowData heightForTable] + 48 
4 UIKit       0x36283400 -[UITableView(_UITableViewPrivate)   _updateContentSize] + 324 
5 UIKit       0x362cc8b4 -[UITableView _rectChangedWithNewSize:oldSize:] + 252 
6 UIKit       0x362cc544 -[UITableView setFrame:] + 220 
7 UIKit       0x362c59c4 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 644 
8 UIKit       0x362c572e -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 262 
9 UIKit       0x3644eb2a -[UIScrollView _resizeWithOldSuperviewSize:] + 38 
10 CoreFoundation     0x35b63aec __NSArrayChunkIterate + 360 
11 CoreFoundation     0x35b5ca74 __NSArrayEnumerate + 608 
12 CoreFoundation     0x35abeb66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58 
13 UIKit       0x3627e09e -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114 
14 UIKit       0x36263ba2 -[UIView(Geometry) setFrame:] + 414 
15 UIKit       0x362c59c4 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 644 
16 UIKit       0x362c572e -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 262 
17 CoreFoundation     0x35b63aec __NSArrayChunkIterate + 360 
18 CoreFoundation     0x35b5ca74 __NSArrayEnumerate + 608 
19 CoreFoundation     0x35abeb66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58 
20 UIKit       0x3627e09e -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114 
21 UIKit       0x36263ba2 -[UIView(Geometry) setFrame:] + 414 
22 UIKit       0x362a6dc0 -[UIViewControllerWrapperView setFrame:] +  48 
23 UIKit       0x362c59c4 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 644 
24 UIKit       0x362c572e -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 262 
25 CoreFoundation     0x35b63aec __NSArrayChunkIterate + 360 
26 CoreFoundation     0x35b5ca74 __NSArrayEnumerate + 608 
27 CoreFoundation     0x35abeb66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58 
28 UIKit       0x3627e09e -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114 
29 UIKit       0x36263ba2 -[UIView(Geometry) setFrame:] + 414 
30 UIKit       0x362c59c4 -[UIView(Geometry) _applyAutoresizingMaskWithOldSuperviewSize:] + 644 
31 UIKit       0x362c572e -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 262 
32 CoreFoundation     0x35b63aec __NSArrayChunkIterate + 360 
33 CoreFoundation     0x35b5ca74 __NSArrayEnumerate + 608 
34 CoreFoundation     0x35abeb66 -[NSArray enumerateObjectsWithOptions:usingBlock:] + 58 
35 UIKit       0x3627e09e -[UIView(Geometry) resizeSubviewsWithOldSize:] + 114 
36 UIKit       0x362c64ae -[UIView(Geometry) setBounds:] + 430 
37 UIKit       0x3634ff32 -[UILayoutContainerView setBounds:] + 58 
38 UIKit       0x363edd88 -[UIViewController window:willAnimateRotationToInterfaceOrientation:duration:] + 460 
39 UIKit       0x3630e2b0 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 3616 
40 UIKit       0x3630d482 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 42 
41 UIKit       0x3630d40c -[UIWindow _setRotatableViewOrientation:duration:force:] + 64 
42 UIKit       0x3644317c __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke_0 + 100 
43 UIKit       0x362cb676 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 214 
44 UIKit       0x362d4d20 -[UIWindow _updateInterfaceOrientationFromDeviceOrientation:] + 176 
45 CoreFoundation     0x35ab9034 _CFXNotificationPost + 1424 
46 Foundation      0x3721bd8c -[NSNotificationCenter postNotificationName:object:userInfo:] + 68 
47 UIKit       0x36268c60 -[UIDevice setOrientation:animated:] + 292 
48 UIKit       0x362633d6 -[UIApplication handleEvent:withNewEvent:] + 2954 
49 UIKit       0x362626c8 -[UIApplication sendEvent:] + 68 
50 UIKit       0x36262116 _UIApplicationHandleEvent + 6150 
51 GraphicsServices    0x318885a0 _PurpleEventCallback + 588 
52 GraphicsServices    0x318881ce PurpleEventCallback + 30 
53 CoreFoundation     0x35b3d170 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32 
54 CoreFoundation     0x35b3d112 __CFRunLoopDoSource1 + 134 
55 CoreFoundation     0x35b3bf94 __CFRunLoopRun + 1380 
56 CoreFoundation     0x35aaeeb8 CFRunLoopRunSpecific + 352 
57 CoreFoundation     0x35aaed44 CFRunLoopRunInMode + 100 
58 GraphicsServices    0x318872e6 GSEventRunModal + 70 
59 UIKit       0x362b62f4 UIApplicationMain + 1116 

既不涉及線程活動也不定製ViewController。而且,我正在使用ARC。

我想知道導致自動旋轉發生時崩潰的原因或可能性的確切原因。

在此先感謝...

+1

你使用ARC嗎? 'libobjc.A.dylib 0x3233a5b0 objc_msgSend + 16'這裏意味着你要發送消息給一個發佈的對象。追溯並檢查你的代碼。在你使用的tableview委託中,一些對象正在被釋放。 – croyneaus4u 2013-05-10 13:24:05

+0

嗯......我正在使用ARC。感謝您的時間和精力......讓我再試一次,告訴我是否成功... – Goppinath 2013-05-10 13:37:40

回答

1

我認爲應用程序發送消息到釋放對象。是的,有時甚至在使用ARC時也會發生。要調試它,你需要運行儀器(殭屍)你的應用程序,並嘗試重現該錯誤。

+0

非常感謝......它幫助了... – Goppinath 2013-05-13 08:31:01

0

使用樂器(殭屍)啓用殭屍和調試應用程序確實有助於查找錯誤。但要修復這個錯誤或避免將來發生同樣的錯誤非常重要。

在我的代碼,我有一個實現這樣的事情...

- (void)someMethod { 

    [self.navigationController pushViewController:[DestinationViewController new] animated:YES]; 

} 

那裏,我們不直接持有DestinationViewController的強引用。但改變...

@property (strong, nonatomic) DestinationViewController *dvc; 

// .... 

- (void)someMethod { 

    self.dvc = [DestinationViewController new];   

    [self.navigationController pushViewController:self.dvc animated:YES]; 

} 

已幫助避免該錯誤。我無法真正解釋爲什麼......?但我希望改變設備的方向會影響DestinationViewController,但通過保持強引用可以避免這種情況。