2010-03-30 27 views
1

我的一位用戶報告他的設備iPhone 3GS發生崩潰。其他類型的設備不報告類似的行爲。他給我發送了一個崩潰日誌,並基於閱讀它,我不知道如何繼續。我希望我不會錯誤地解釋崩潰日誌,但它看起來並不像我的操作已被調用。完整性檢查:UIBarButtonItem崩潰嘗試執行操作

這是我如何創建和設置的UIBarButtonItem:

- (void)viewDidLoad { 
    [super viewDidLoad]; 
    UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addLog:)]; 
    self.navigationItem.rightBarButtonItem = addButton; 
    [addButton release]; 
} 

這是我的操作方法:

- (IBAction)addLog:(id)sender { 
    MyViewController *myController = [[MyViewController alloc] initWithNibName:@"MyNib" bundle:nil]; 
    UINavigationController *subNavigationController = [[UINavigationController alloc] initWithRootViewController: myController]; 
    [self presentModalViewController:subNavigationController animated:YES]; 
    [myController release]; 
    [subNavigationController release]; 
} 

這是崩潰日誌:

 
Exception Type: EXC_CRASH (SIGABRT) 
Exception Codes: 0x00000000, 0x00000000Crashed Thread: 0 
Thread 0 Crashed: 
0 libSystem.B.dylib     0x0007e98c __kill + 81 libSystem.B.dylib     0x0007e97c kill + 4 
2 libSystem.B.dylib     0x0007e96e raise + 10 
3 libSystem.B.dylib     0x0009361a abort + 34 
4 MyApp        0x000042e8 0x1000 + 13032 
5 CoreFoundation      0x00058ede -[NSObject performSelector:withObject:withObject:] + 18 
6 UIKit        0x0004205e -[UIApplication sendAction:to:from:forEvent:] + 78 
7 UIKit        0x00094d4e -[UIBarButtonItem(Internal) _sendAction:withEvent:] + 86 
8 CoreFoundation      0x00058ede -[NSObject performSelector:withObject:withObject:] + 18 
9 UIKit        0x0004205e -[UIApplication sendAction:to:from:forEvent:] + 78 
10 UIKit        0x00041ffe -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26 
11 UIKit        0x00041fd0 -[UIControl sendAction:to:forEvent:] + 32 
12 UIKit        0x00041d2a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 350 
13 UIKit        0x0004263e -[UIControl touchesEnded:withEvent:] + 330 
14 UIKit        0x00041656 -[UIWindow _sendTouchesForEvent:] + 318 
15 UIKit        0x00041032 -[UIWindow sendEvent:] + 74 

回答

2

崩潰報告未被符號化。我不能因爲該行的電話:

4 MyApp        0x000042e8 0x1000 + 13032 

在symbolicated崩潰報告,這條線將顯示您的哪些方法崩潰內容時發生。

當您創建發佈版本時,將從二進制文件中去除調試符號。您需要在構建後保存構建文件夾中的.dSYM文件和應用程序包。

這些都需要符號化崩潰報告。

如果您保存了這些文件,那麼您需要確保它們位於聚光燈可以訪問的位置。如果崩潰報告是由用戶發送給您的,請嘗試將其拖入Xcode Organizer窗口中的崩潰報告選項卡。這應該試圖表示崩潰報告(但只有擁有.dSYM和應用程序包時纔會成功)。

+0

謝謝!我能夠確定導致該信息崩潰的原因。 – Giao 2010-03-30 13:53:12

+0

沒問題。請記住,對於將來的版本,請確保保存.dSYM和App Bundles。 Xcode 3.2.2可能有一個功能來幫助強制執行此操作;) – Jasarien 2010-03-30 13:56:02