ios - 不支持推送导航 Controller

在我的 MainStoryBoard 中,我想将 viewController 推送到 detailView,但出现此错误:

NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'

我在 Storyboard 上为 viewController 设置了标识符“JSA”ID。

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        SWSJSAViewController *viewController = [[UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil] instantiateViewControllerWithIdentifier:@"JSA"];
        [self.navigationController pushViewController:viewController animated:YES];
    }
}

最佳答案

喜欢 rmaddy在评论中说您正在尝试推送导航 Controller 。

应该显示导航 Controller (通过 presentViewController 或者它们可以作为 childViewController 添加)并且应该推送 ViewControllers。

https://stackoverflow.com/questions/17757072/

相关文章:

ios - AVPlayer 和 Video 的屏幕截图

objective-c - [Facebook-iOS-SDK 4.0]如何从FBSDKProfil

iphone - 所有文本字段的 resignFirstResponder

ios - 我可以设置 `attributedText` 的 `UILabel` 属性吗

ios - 选择时如何更改 UITableViewCell 的颜色?

objective-c - Xcode:可以为协议(protocol)接口(interface)所需

ios - 检测设备是否支持电话?

ios - 使用 Xcode 进行模拟时,PerformFetchWithCompletionHan

objective-c - 仅在 UIView 顶部的圆角

objective-c - 实现 -hash/-isEqual :/-isEqualTo. ..:用