MK_ MK_ - 1 year ago 85
Swift Question

ERROR after clicking an Button Thread 1: Signal SIGABRT

Hello when I launch my App on my iPad 2 and click a BarButtonItem I get this Error.

2016-08-09 15:06:14.030 exampleApp[2880:1685434] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Storyboard () doesn't contain a view controller with identifier 'QRCodeView''
First throw call stack:
(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: terminating with uncaught exception of type NSException

Any ideas?

Answer Source

Seems like you are trying to get view controller with identifier "QRCodeView".

I assume that you have some code in that button action that looks like:

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

with possible cast like:

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

and that acutally fails. Check your storyboard identifiers.