gpt4 book ai didi

iOS 7 presentViewController 显示黑屏和 SIGABRT

转载 作者:行者123 更新时间:2023-12-01 17:40:55 25 4
gpt4 key购买 nike

我通过在方法 [ViewDidLoad] 中编写代码来使用右侧 UIBARBUTTON 上的两个按钮。

  • http://i.stack.imgur.com/VcOEW.png
  • http://i.stack.imgur.com/vG3eT.png
  • http://i.stack.imgur.com/f0xsB.png

  • 我想使用 +plus 按钮移动到 AddNameViewController 但它会导致 Fail[sigabrt] .
  • http://i.stack.imgur.com/MBq2m.png
  • http://i.stack.imgur.com/Hdw8T.png

  • 我认为错误在以下代码中。
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    AddNameViewController *sfvc = [storyboard instantiateViewControllerWithIdentifier:@"AddNameViewController.m"];
    [sfvc setModalPresentationStyle:UIModalPresentationFullScreen];
    [self presentViewController:sfvc animated:YES completion:nil];

    最佳答案

    改变这个:

    AddNameViewController *sfvc = [storyboard instantiateViewControllerWithIdentifier:@"AddNameViewController.m"]

    为了这:
    AddNameViewController *sfvc = [storyboard instantiateViewControllerWithIdentifier:@"AddNameViewController"]

    您需要 View Controller 的名称,而不是文件。

    关于iOS 7 presentViewController 显示黑屏和 SIGABRT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20078629/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com