2014-11-24 144 views
0

我有一個按鈕在我的ProfileView視圖控制器筆尖調用時按下我去顯示OptionsView視圖控制器。筆尖導航線程1:信號SIGABRT

在我ProfileView.m文件我這是viewDidLoad中:

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Options"  style:UIBarButtonItemStylePlain target:self action:@selector(actionOptions)]; 

,然後我有:

- (void)actionOptions 
{ 
    OptionsView *screen = [[OptionsView alloc] initWithNibName:@"OptionsView" bundle:Nil]; 
    [self.view addSubview:screen.view]; 
} 

但每當我點擊按鈕,我得到一個線程1:信號SIGABRT與以下控制檯輸出:

2014-11-24 13:43:54.107 app[2161:5537921] didFailToRegisterForRemoteNotificationsWithError Error Domain=NSCocoaErrorDomain Code=3010 "remote notifications are not supported in the simulator" UserInfo=0x7ff7c2c365d0 {NSLocalizedDescription=remote notifications are not supported in the simulator} 
2014-11-24 13:43:55.673 app[2161:5537921] *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UITableView.m:7344 
2014-11-24 13:43:55.676 app[2161:5537921] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:' 
+0

爲什麼你不能只將按鈕鏈接到筆尖的IBAction? – 2014-11-24 18:50:34

+0

當我這樣做時,我得到同樣的錯誤 – 2014-11-24 18:58:03

+1

您的問題似乎與您發佈的代碼沒有任何關係。你讀過你發佈的控制檯輸出了嗎? – stromdotcom 2014-11-24 19:04:19

回答

0

You hav e SIGABRT,因爲在OptionsView中顯示的tableview數據源沒有從tableView:cellForRowAtIndexPath:方法返回有效的單元格。 您發佈的代碼是確定的。