2016-08-09 61 views
0

当我在iPad 2上启动我的应用程序并单击BarButtonItem时出现此错误。单击按钮后出现错误线程1:信号SIGABRT

2016年8月9日15:06:14.030 ExampleApp中[2880:1685434] *终止应用程序由于未捕获的异常 'NSInvalidArgumentException',原因:“故事板()不包含视图控制器与识别符 '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

有没有想法?

回答

0

好像你正试图获取带有标识符“QRCodeView”的视图控制器。

我假设你有一些代码在该按钮的动作,看起来像:

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

有可能投这样的:

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

而且实际上可以失败。检查你的故事板标识符。