Search code examples
iosswiftuibuttonactionnsunknownkeyexception

Swift NSUknowKeyException SIGABRT on launch


Okay I am having a major error here. I think the problem arose when I used the Assistant editor to link an Action from my captureButton to a captureButtonPressed. but I accidentally chose linked it as an Outlet, then I deleted the Outlet and did it again with the Action.

Here is the error:

2014-12-09 16:29:17.611 Penny[2593:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Penny.ViewController 0x156511600> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key captureButtonPressed.'
asdf

Is it possible that it is still looking at the old linking? Is there a place where I can view all the linkings? I comment out my catureButtonPressed action and the error persists.

Thanks


Solution

  • This exception usually means that you have an outlet in your storyboard that doesn't exist in your code, so that probably is the problem. You deleted the outlet from your code, causing the key-value coding mechanisms that hook up outlets to fail. You can delete the outlet from your XIB by selecting your captureButton, opening the Connections inspector in Interface Builder, and deleting the outlet from the Referencing Outlets section.