单击按钮线程1后的错误:信号SIGABRT

时间:2016-08-09 13:10:49

标签: ios swift xcode

您好,当我在iPad 2上启动应用程序并单击BarButtonItem时,我收到此错误。

2016-08-09 15:06:14.030 exampleApp [2880:1685434] *由于未捕获的异常'NSInvalidArgumentException'终止应用程序,原因:'Storyboard()不包含标识符为'QRCodeView的视图控制器“” * 第一次抛出调用堆栈: (0x2483c10b 0x23fe2e17 0x29061941 0xcd57c 0xcd9a0 0x289b06cd 0x28b30601 0x289b06cd 0x289b0659 0x2899864f 0x2899877b 0x289affb5 0x2896a275 0x247fef59 0x247fd25d 0x247fd68f 0x24750bf9 0x247509e5 0x2599cac9 0x289e0ba1 0xd07b4 0x243ff873) libc ++ abi.dylib:以NSException类型的未捕获异常终止

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

好像你正试图获得标识符为“QRCodeView”的视图控制器。

我假设您在该按钮操作中有一些代码如下:

let story = UIStoryboard(name:"YourStoryboard", bundle: nil)
let vc = story.instantiateViewControllerWithIdentifier("QRCodeView")

可能会像:

let vc = story.instantiateViewControllerWithIdentifier("QRCodeView") as? QRCodeView

并且实际上失败了。检查您的故事板标识符。