在我UITableView
,當用戶點擊一個細胞我發起賽格瑞像這樣:發起`推導航控制器推賽格瑞結果不支持`
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier:@"MCExpandedSegue" sender:self];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"MCExpandedSegue"]){
// Opens item in browser
MCExpandedViewController *controller = (MCExpandedViewController *) segue.destinationViewController;
}
}
爲了目標視圖控制器(MCExpandedViewController
)有一個導航欄和後退按鈕,我已經嵌入它的導航控制器,像這樣:
然而,在攻表中的單元格,以使這個SEGUE,我明白了以下錯誤:*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'
。這是因爲它試圖延續到MCExpandedViewController,但因爲它包含在導航控制器中而被絆倒了?我怎樣才能正確地使用這個segue?
是'MatchCenterViewController'已經是'UINavigationController'裏面?如果是這樣的話,你可以嘗試刪除中間的'UINavigationController'並將segue直接添加到'ExpandedViewController'?您可以通過訪問嵌入在導航控制器中的任何視圖控制器內的'self.navigationController'來控制導航控制器的外觀。 –