简体   繁体   English

从ViewController加载一个storyboard(UITableViewController)

[英]Load an storyboard (UITableViewController) from ViewController

I want to load an storyboard from a ViewController. 我想从ViewController加载一个故事板。 Currently my code looks as follows: 目前我的代码如下:

- (IBAction)Button_Action:(id)sender
{
    UIStoryboard * sb = [UIStoryboard storyboardWithName:@"AddReportView" bundle:nil];
    AddReportViewVC * vc = [sb instantiateViewControllerWithIdentifier:@"AddReportView"];
    [self.navigationController pushViewController:vc animated:true];
}

The view is pushed but I do not see my expected View Controller (which is a UITableViewController) instead I just see an empty gray view controller. 视图被推送但我没有看到我期望的View Controller(这是一个UITableViewController),而是我只看到一个空的灰色视图控制器。

Remember that in both the identifier name and the storyboard name, capitalization matters. 请记住,在标识符名称和故事板名称中,大小写很重要。 I've gotten this wrong so many times... 我这么多次弄错了......

问题是xcode生成的代码的功能使表视图控制器刷新内容。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM