简体   繁体   English

iOS-情节提要中的导航控制器

[英]iOS - navigation controller from storyboard

I have embedded my view controller in a navigation controller on my storyboard, then added a table view which I configured from code. 我将视图控制器嵌入情节提要中的导航控制器中,然后添加了一个从代码配置的表格视图。 I'm trying to make it, when I click a row in the table, it should change the view and putting the subview into the stack, however I can't access the navigation controller. 我试图做到这一点,当我单击表中的一行时,它应该更改视图并将子视图放入堆栈中,但是我无法访问导航控制器。

[self.navigationController pushViewController:disclosureView animated:YES];

When this code launches, it gives the error: " NavController[990:c07] Application tried to push a nil view controller on target . " 启动此代码时,它将显示错误:“ NavController [990:c07]应用程序试图将nil视图控制器推入目标。”

I hope that you didn't get call the ViewController properly : 我希望您没有正确调用ViewController:

if(indexPath.row == 0)

   UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
        UIViewController *disclosureView = [storyboard instantiateViewControllerWithIdentifier:@"disclosureView" ];

        [self.navigationController pushViewController:disclosureView animated:YES];

Here is the screenShot for getting the UIViewController identifier: 这是获取UIViewController标识符的screenShot: 在此处输入图片说明

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法从iOS中的情节提要中嵌入导航控制器 - unable to embed Navigation Controller from storyboard in iOS iOS Storyboard-导航控制器不起作用 - iOS Storyboard - Navigation Controller Not Working iOS导航控制器/ Storyboard认为主要优势是什么? - iOS Navigation Controller/Storyboard Segues Major Upside? iOS情节提要如何在不使用导航控制器的情况下使用“推送”样式从右呈现控制器? - iOS storyboard how to present a controller from right using “push” style without navigation controller? iOS 13 从视图 controller 移动到另一个 storyboard 及其导航 Z594C103F2C6E010C3D8AB059CF - iOS 13 move from view controller to another storyboard with its navigation controller iOS / Storyboard:何时真正需要在导航控制器中嵌入视图控制器 - IOS/Storyboard: When is it really necessary to embed a view controller in a navigation controller 通过不同故事板、Swift、iOS、Xcode 上的 segue 和 Navigation 将数据从一个控制器传递到另一个控制器 - Pass data from one controller to another via segue and Navigation on different storyboard, Swift, iOS, Xcode 故事板-ViewController中的导航控制器 - Storyboard - navigation controller in viewcontroller 情节提要中的自定义导航控制器 - Custom Navigation controller in Storyboard 无法在iOS中使用Storyboard删除导航控制器中的BackButton - Unable to remove BackButton in Navigation controller using Storyboard in ios
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM