【问题标题】:signal SIGABRT in segue from button信号 SIGABRT 在 segue 从按钮
【发布时间】:2020-09-10 23:05:56
【问题描述】:

我有问题。我从按钮到视图控制器做了一个segue,我收到了这个错误。我已经找了 4 个小时了,但这里有类似的问题,不是我的。

This is my error This is description from the console

【问题讨论】:

  • segue 似乎直接连接到Test 视图控制器。尝试将 segue 重新连接到嵌入了 Test 的导航控制器。

标签: swift xcode segue sigabrt


【解决方案1】:

我认为你可以重写 prepare 方法来满足这个 sn-ps 它比你使用的那个更好

override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "MySegueId" {
    if let nextViewController = segue.destination as? NextViewController {
            nextViewController.valueOfxyz = "XYZ" //Or pass any values
                                                                         }
                                    }
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-10-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-30
    • 1970-01-01
    相关资源
    最近更新 更多