从 Storyboard 呈现 UITableViewController
我已经在我的故事板中构建了一个 UITableViewController,现在需要以编程方式呈现它(我无法链接故事板中的转换/segue)。
我已将自定义 UITableViewController 类链接到我在故事板中制作的控制器,并在需要时导入并尝试在我的代码中像这样呈现它:
AddEventViewController *vc = [[AddEventViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
但是,它没有获取我在故事板中所做的任何内容,纯粹基于课堂内容。
I have built up a UITableViewController inside my storyboard and now need to present it modally programatically (I can't link the transition/segue inside my storyboard).
I have linked my custom UITableViewController class to the controller I made in the storyboard and imported where required and trying to present it like so in my code:
AddEventViewController *vc = [[AddEventViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
However, it picks up nothing I have done in the storyboard, purely basing what is shown by the class contents.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
结果我只需要用这个来代替:
愚蠢的我。
Turns out I just needed to use this instead:
Silly me.