NSUnknownkey exception not raised everytime at the same place in code , Why? - ios

I have a ViewController which has a corresponding .xib for view. Now in that .xib file there are certain UILabels which DO NOT exist in header file, meaning that they were removed from header but still appear yellow(warning) in .xib.
When I run this code, it sometimes runs fine but sometimes it crashes with following error :
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key messagesLabel.'
I know the solution but what I want to understand is why is the code not crashing everytime?
Attached is the screenshot of .xib file

Related

NSUnknownKeyException for a UIButton. Correctly added referencing outlets and corresponding function

I am facing an NSUnknownKeyException for a back button present on a Storyboard, i.e. FastGazeExtension. I have correctly connected the back button to the UIButton outlet property in the controller, i.e. backBTN_FGE, and referenced an action function, i.e. backToWebPageMenu for the back button that wouldn't do anything for now.
Additionally, none of the referencing outlets show any inactive connections. How can I solve the following exception:
2022-05-02 19:13:22.836066-0400 Application1[12433:4224720] [Storyboard] Unknown class _TtC8EApplication118FastGazeController in Interface Builder file.
2022-05-02 19:13:22.839695-0400 Application1[12433:4224720] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x137ecdef0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key backBTN_FGE.'
*** First throw call stack:
(0x19a88e86c 0x1af8a7c50 0x19a7965c8 0x19bad8f58 0x19cb17dd8 0x19ce54fa4 0x19a76e0c8 0x19ce50d6c 0x19cb1f8c0 0x19cb1fc7c 0x19cb20334 0x19ca0d5c0 0x19ca00798 0x19cb32750 0x19cb33a6c 0x19cb33dcc 0x19cb339b8 0x19cb33ea8 0x104bd4ea4 0x104b165f4 0x104b16710 0x1a7081270 0x1a71718b4 0x1a717f888 0x1a717f6fc 0x1a744e0a0 0x1a6e6da1c 0x1a71a25dc 0x1a6e50c4c 0x1a6e50490 0x1a4b795e0 0x1a4b7a2c8 0x19a80a76c 0x19a80a668 0x19a809960 0x19a803a8c 0x19a80321c 0x1b23cd784 0x19d243ee8 0x19d24975c 0x104b1974c 0x19a4c36b0)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x137ecdef0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key backBTN_FGE.'
terminating with uncaught exception of type NSException
FastGazeController: Controller associated with the Storyboard.
Connections for the key under consideration:
All referencing outlets in the storyboard:
Note: I have copied this storyboard in my application from another application.
Go to your controller in storyboard. Delete the class name "ie: FastGazeController". Type it again and press enter.
Also check if you added the copied files to the target.
The first line of the warning/error stated:
2022-05-02 19:13:22.836066-0400 Application1[12433:4224720] [Storyboard] Unknown class _TtC8EApplication118FastGazeController in Interface Builder file.
The Interface Builder couldn't find the controller file and all of the subsequent referencing outlets were marked as not key-value coding-compliant.
After digging into the problem for some time, I found out that the target membership for folder (A) containing the controller file(B) included my application. However, target membership was not visible for the controller file itself. When I deleted folder A and added a new swift file(C) inside another folder that hadn't any visible target membership associated with it, and included logic of file B inside this new file/controller (C), it started working.
Note: I included my application directly as a target member of file C. I associated file C with the storyboard that I was working on.
Later on, I didn't face any issues with referencing.

Updated to Xcode5 simulator through get SIGABRT Error

An app I recently started and working its keeps crashing with a SIGABRT message. The general message at the top of the debugger says:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIView 0xb651580> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key parentEmail.'
... At the the bottom it says:
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Let me know if the "first throw call stack" info is necessary to solve this one.
Check and make sure that you didnt previously have a button/text field/label previously linked with an action, then deleted that item. The link still exists. Check and make sure that all your links match to existing items.
Usually this comes from an outlet link inside a xib with no corresponding class variable.
Did you remove a variable from a class without removing the link inside the xib?

This class is not key value coding-compilant for the key optionsSection

I am a newcomer in developing. I make my project with TabBar. When I run my project on iPhone Simulator I can see FirstViewController. When I put on my Second Controller Icon on TabBar, project crashes and give me that issue.
2013-07-05 12:31:16.238 MyProject[26912:c07] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key optionsSection.'
* First throw call stack:
(0x1d76012 0x1529e7e 0x1dfefb1 0xcc5e41 0xc475f8 0xc470e7 0xc71b58 0x37b019 0x153d663 0x1d7145a 0x379b1c 0x23e7e7 0x23edc8 0x38d28e 0x23eff8 0x23f232 0x2608c9 0x260704 0x25ebda 0x25ea5c 0x260647 0x153d705 0x1612c0 0x161258 0x383ff4 0x153d705 0x1612c0 0x161258 0x222021 0x22257f 0x222056 0x387af9 0x153d705 0x1612c0 0x161258 0x222021 0x22257f 0x2216e8 0x190cef 0x190f02 0x16ed4a 0x160698 0x1896df9 0x1896ad0 0x1cebbf5 0x1ceb962 0x1d1cbb6 0x1d1bf44 0x1d1be1b 0x18957e3 0x1895668 0x15dffc 0x292d 0x2855)
libc++abi.dylib: terminate called throwing an exception
(lldb)
Please, give me some solutions of this problem.
If you have provided a key in interface builder to some UILabel or any such UI instance of that missing key and then removed,that causes that error. Ctrl click the file's owner of view controller and remove the missing key(key with a yellow cross mark) from there.
Its the one of the answers I posted here on this SO thread whose problem looks just like yours.

connection error outlet

I can't create any connection of objects in my class, is there any way to see how the objects are connected in my class?. The Xcode gives me this error:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<VistaInicio 0x68879e0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key myButton.
There is no myButton outlet in the VistaInicio class. Yet something in some xib is connected to it (probably it was connected before you removed this outlet). You need to go through your Interface Builder files and remove the broken connection.

iOS nib issue, causing crash

I have a rather peculiar error in my app
It only just started happening after it being fine for so long, all my nibs are wired up correctly from what I can see
Any other advice would be greatly appreciated
The error is as follows
2012-07-06 15:07:22.761 xxxxx[681:f803] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key MyTableView.'
* First throw call stack:
(0x1907022 0x1b64cd6 0x1906ee1 0x11df022 0x1150f6b 0x1150edb 0x116bd50 0xa5371a 0x1908dea 0x18727f1 0xa5226e 0xa53eb7 0x830ce1 0x830ff8 0x83017f 0x83f183 0x83fc38 0x833634 0x1f4cef5 0x18db195 0x183fff2 0x183e8da 0x183dd84 0x183dc9b 0x82fc65 0x831626 0xe544 0x2255)
terminate called throwing an exception
If theres anything I can do to provide extra please let me know
Thanks all
This means that you have an outlet defined somewhere in your xib called 'MyTableView' and there is no property by that name.
Check all of your outlets!

Resources