简体   繁体   English

Xcode 8.2模拟器显示白屏并给出SIGABRT错误

[英]Xcode 8.2 simulator showing white screen and giving SIGABRT error

I'm new to app development and I'm learning as I go. 我是应用程序开发的新手,我正在学习。 I started a new project and set the image background via image view and a png. 我开始了一个新项目,并通过图像视图和png设置了图像背景。 Before preceding with anything else, I wanted to make sure that at least my background would show in the simulator. 在进行其他任何操作之前,我想确保至少我的背景会显示在模拟器中。

When I run the simulator it shows a white background for a few seconds then Xcode pops up in AppDelegate with a 当我运行模拟器时,它显示白色背景几秒钟,然后Xcode在AppDelegate中弹出,

[4904:767382] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard () doesn't contain a view controller with identifier 'DataViewController'' First throw call stack: ` [4904:767382]由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“ Storyboard()不包含标识符为“ DataViewController”的视图控制器”第一个调用堆栈:

错误

仿真器

背景

Can anyone explain what the problem maybe? 任何人都可以解释这个问题吗?

Try to add the Storybaord ID ( DataViewController ) to your view controller in storybaord 尝试将Storybaord ID(DataViewController)添加到storybaord中的视图控制器

a line like this may cause the crash 这样的线可能会导致崩溃

   let vc = self.storyboard?.instantiateViewController(withIdentifier:"DataViewController")

    self.navigationController?.pushViewController(vc!, animated: true)

在此处输入图片说明

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

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