2012-05-28 94 views
0

我有這樣的代碼:與負載的DetailView問題

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{ 
    TabellenDetailViewController *detailViewController2 = [self.storyboard instantiateViewControllerWithIdentifier:@"TabellenDetailViewController"]; 
    Book2 *aBook2 = [books2 objectAtIndex:indexPath.row]; 
    detailViewController2.tea_names = [NSString stringWithFormat:@"%@", aBook2.tea_name]; 
    [self.navigationController pushViewController:detailViewController2 animated:YES]; 
} 

爲了更好地理解我有一個故事板:

導航控制器 - > MasterTableViewController - > DetailMasterTableViewController - > TabelleViewController - > DetailTabelleViewcontroller

它對TabelleViewController工作正常,如果我在TabelleViewController中選取一個單元格,則程序停止該錯誤:

int main(int argc, char *argv[]) 
{ 
    @autoreleasepool { 
     return UIApplicationMain(argc, argv, nil, NSStringFromClass([XMLAppDelegate class])); <--- Here with Thread1:Program received signal: "SIGABRT". 
    } 
} 

回答

0
  • 檢查tea_names屬性由TabellenDetailViewController實例保留
  • 添加例外斷點,看看具體的異常位置

Click on the Breakpoints symbol (2nd from the right) in the Navigator pane, click the + button at the bottom of the pane, and select Add Exception Breakpoint. From the bubble that appears, I selected Objective-C from the Exception choice (although I suspect you can safely leave it at all if you desire), and I left the Break selection at On Throw. Once you click Done, you should then have a new exceptions breakpoint in the list. (read more)

+0

問題so LVED! 問題是我改變了錯誤的故事板中的繁榮! Thx很多! –