调用dismiss方法时iOS应用程序崩溃

时间:2018-03-19 14:40:54

标签: ios swift uinavigationcontroller uitabbarcontroller dismissviewcontroller

从嵌入UITabBarController的UIViewController我执行模态segue

self.present(.....

生活"自我"我的视图控制器在我的UITabBarController中。新的ViewController显示完美,让我们称之为ViewController2 ViewController1以模态方式呈现它。如果我试图解除ViewController2,它总是会因未知例外而崩溃。 libc++abi.dylib: terminating with uncaught exception of type NSException. ViewController2已嵌入UINavigationController,但此ViewController2是唯一崩溃的presentingViewController

我尝试解雇presentationControllerpresentedViewControllerself.navigationController?.dismissUITabBarController->ViewController1 -modally present- UINavigationController->ViewController2,但没有任何内容对我有用。

架构为:guard let vcDetail = UIStoryboard(name: "ProjectDetailStoryBoard\(currentDevice)", bundle: nil).instantiateViewController(withIdentifier: "vcDetailProject") as? ProjectDetailController else{return} vcDetail.instantiatedFromPushNotification = true vcDetail.projectId = key let vc = UINavigationController(rootViewController: vcDetail) UIApplication.topViewController()?.present(vc, animated: true, completion: nil)

这是我的呈现代码:

@IBAction func dismissView(){

    dismiss(animated: true, completion: nil)
}

这是我的解雇代码:

{% for radio in form.client_profile %}
    <label for="{{ radio.id_for_label }}">
        {{ radio.choice_label }}
        <span class="radio">{{ radio.tag }}</span>
    </label>
{% endfor %}

0 个答案:

没有答案