This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 7 years ago.
I've been looking through the archives and haven't found a question that answers this. So I'm hoping this is something obvious I'm just missing.
I have an iphone app that's been in the store with various releases over the last 2 years. I finally got frustrated with managing orientation changes through nib files. So I've removed my nib completely from the project and I create all of my fields through code now.
I saw an odd crash in my testing after I'd removed the nib file. But I did some clean up work and couldn't reproduce it. So I've shipped the product. A small subset of my users have seen a crash situation.
I believe I was able to reproduce it in my debugger and got this output.
2012-10-22 08:08:22.776 ChakraChimePro[60502:16d03] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason:
'[<CCProChimeViewController 0x8578100> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key btnRingBowl.'
*** First throw call stack:
(0x1f57022 0x1ccacd6 0x1f56ee1 0x2b6022 0x227f6b 0x227edb 0x242d50 0x78871a 0x1f58dea 0x1ec27f1 0x78726e 0x62d1fc 0x62d779
0x62d99b 0x6490a9 0x648edd 0x6474aa 0x64729e 0x351b 0x564386 0x565274 0x574183 0x574c38 0x568634 0x20eaef5 0x1f2b195 0x1e8fff2
0x1e8e8da 0x1e8dd84 0x1e8dc9b 0x564c65 0x566626 0x2ef6 0x2e25)
terminate called throwing an exception(lldb)
so I've completely removed my class property btnRingBowl. There is no reference to it in the class any more. But I've also completely removed the nib file that was attached to the IBOutlet. So there shouldn't be any reference to it anymore.
Why is my binary still trying to access it?
I've tried deleting the app and reinstalling and the problem goes away.
I've installed the same version of the app that's up on the app store and the problem goes away. I can't reproduce the problem on demand. But I can reproduce it and it's causing crashing for my users.
Since I've completely removed the nib and the properties. I don't know what else I can clean up. Any suggestions?
A string search of my project reveals no reference to this name anywhere.
Thanks,
Kevin
Ran into the same exact problem. NIB/XIB files had been removed long ago (before my initial submit), and only with a recent update fix did this pop-up.
I ended up restoring the old nib files from git, and everything worked. Then removed the broken IB Outlets, rebuild project with those XIB files, and proceed onwards.
I'm not sure if restoring the old nib files will be an option for you, and if not, perhaps rebuilding another nib file of the same name, and force rebuild the project with the new nib file (so it clears the old references out?)
Related
I'm getting this error on a project i've been working on for a while : "Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'" (it does with each of my outlets).
My app was working very well until I tried to bypass code-signing, and tried to do some Profiling with Instruments (I actually found out the error with Instruments).
(Additionnal info) I've built a subclass of UIViewController, with .h .m and .xib files, named EEMainViewController. I instantiate it in my EEAppDelegate to display it as a subview of my main window. In the .xib, I have 1 view, 3 UIPickers and 2 UITextField. As soon as only one of the outlets gets linked to the FO, the program exits and throws the error, and when none is linked, it says that the 'view' property has not been set (which is normal, since it's not connected).
I already checked all the IB and Bindings blahblah, and nothing seems to work in my case : all my outlets are connected properly (XCode is showing grey dots next to the #property in the .h file) and I'm instantiating the right classes in my code. It's pretty weird.
If you want a piece of code (only a piece, it's became really huge), feel free to ask me for some.
Thanks for reading !
I found a solution to my problem : I erased the EEMainViewController from my project (making sure all the outlets in my .xib were disconnected) and pasted the .h and .m content in a new class I created named EERootViewController, replacing all the occurrences of "EEMainViewController" by "EERootViewController" in my code. I rebuilt the .xib from scratch and connected as i was doing previously. Everything seems to work fine.
I don't know where the problem was coming from, unfortunately, so I guess we won't learn anything more about this case.
I still don't mark this thread as done, in case s.o finds the reason to the problem.
Sorry for bothering !
You can see the error in the image.
I don't even know what these errors mean, it was working fine before I updated Xcode for the iOS 6 update. I've done a few things to try and fix it such as change the target OS and do a Clean, but that has not worked.
I get the error after the app successfully is built and pushed to the device.
Your application crashed at runtime, because there was an exception.
The exception is written in your console log. We can see it in your capture:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x...> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key view.'
This means that somewhere in your application, you tried to set the "view" property of an object of type UIApplication, but UIApplication does not have any view property, so this crashes.
This is very likely that in your MainWindow.xib file, you connected a view IBOutlet to an object of type UIApplication, but this binding of your outlet is invalid because the outlet does not exist anymore.
(maybe you added the outlet at a given time, and binded/connected it in IB, and then removed it in your code, or maybe you binded the IBOutlet then changed the class of your object so the new class does not have the same outlets at all, whatever the outlet is now binded to a non-existant property in your XIB and that generates the crash)
To fix this, open your XIB file in interface builder and remove this invalid connection to your now non-existant outlet, and your exception should go away.
It means your program crashed. The error is in that box in the corner right. I can't see the whole error message, but it has something to do with key-value coding.
It might be the simple fact that you're running a slightly outdated version of your program. Delete it from the simulator or your device, clean and re-build your project, and let Xcode re-copy it over.
This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 7 years ago.
Sorry for asking such an easy question, but im a beginner
I was following a tutorial on building apps.
I was creating a button, but i accidently named it wrong, i named it instead of when creating the outlet. I named it right though when i created the action. I ran my app and it failed, because my instances called on , not (at least i think thats why my app crashed. So deleted the outlet and and the automatic code xcode writes for the outlet, i remade the outlet and named it right this time. But now when i run my app it terminates, heres the report:
2012-08-21 20:42:07.602 FieldButtonFun[973:c07] * Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key theNutton.'
* First throw call stack:
(0x14b2022 0xeb2cd6 0x14b1ee1 0x9c3022 0x934f6b 0x934edb 0x94fd50 0x23771a 0x14b3dea 0x141d7f1 0x23626e 0xdc1fc 0xdc779 0xdc99b 0x3b401 0x3b670 0x3b836 0x4272a 0x13596 0x14274 0x23183 0x23c38 0x17634 0x139cef5 0x1486195 0x13eaff2 0x13e98da 0x13e8d84 0x13e8c9b 0x13c65 0x15626 0x271d 0x2685)
terminate called throwing an exception
I have no idea what went wrong and i dont understand the error report at all. I thought i already deleted all the automatic code Xcode generated when i created the outlet and remade it. Could anyone help me and find out what could have went wrong?
I could rebuild this app from scratch but i want to understand why this went wrong, for future reference.
Xcode cannot find the value for the key theNutton in the class FieldButtonFun.
It's hard to say what's wrong without see the actual code. But in most cases, there could be a bad connection in the XIB file. Please check the XIB, ctrl-click the File's Owner, see if there is any yellow warning.
Click on your .xib then you will see the files'Owner on top right click on it and check you have any connection in yellow if you have then please click on cross button(X) and from xib right click and drag connection to filer'owner from your uibutton to make action(method)connection.
Then right click and drag from filer'owner to IBOutlet(the uiobject you declare as IBOutlet in your interface).
this error drives me crazy. I already spent hours on fixing this, unfortunately without success.
I tested my app in simulator, everything works fine. I'am testing it on my device (iphone 4 with ios 4.3.3) the app won't start.
So I tried creating a new project, build and go. And the end of the error now says instead of viewcontroller, key window.
To get further information about the error I setup an exeption breakpoint whicht breaks on throw and on all exeptions. Something interesting happend now: when I am launching the empty project on my iphone I get a warning:
warning: Unable to read symbols for /Users/xxx/Library/Developer/Xcode/DerivedData/testing-cmaekkzgdqyseidlqkorvrdvvodg/Build/Products/Debug-iphoneos/OLDAPP.app/testing (file not found). (The app which I am runnning is called testapp, not OLDAPP?! This was my last project!)
Some further errors now occure:
Unknown class OLDAPPAppDelegate in Interface Builder file. and Unknown class RootViewController in Interface Builder file.
I did clean all targets and made a clean build. Nothing changes…
I didn't change anything in IB, just edited the provisioning profile to run the app on my phone.
Help is very appreciated here :-) Hopefully someone can help me I would be really thankful.
The whole error message: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UICustomObject 0x18b410> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key window.'
This happens to me if I change the name of an outlet on the ViewController which was connected to something in the View in Interface Builder. For example, renaming 'labelFirstName' to 'lblFirstName' and forgetting to break and recreate the connection in IB.
I had the same problem where there were no !'s in my XIB and no re-naming problems. To fix it, I just created a new XIB, copied in the view from the old XIB, and rewired all the connections.
This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
(79 answers)
Closed 7 years ago.
Im new im making in making iPhone apps so i have no idea what this error means ?
I saw another post with this error but i couldn't figure out how to get it right..
i get this error:
Terminating app due to uncaught exception
'NSUnknownKeyException', reason: '[
setValue:forUndefinedKey:]: this class is not key value coding-compliant for
the key ImageView.'
and i have no clue what this means ? 0.o
can some help me here ?
Thanks!
You might have changed the name of the IBOutlet your nib file refers to.
Check each connection in your nib file to see what it references
Search in your code for that reference to confirm it's there.
Check your nib to see if you have an outlet or action hooked up to a property that no longer exists in the view controller.
I ran into this issue after deleting an object I created in Interface Builder. Deleting the object did not erase all of the code artifacts it had produced.
Here is how I removed the unwanted information in XCode 4.3:
Ctrl + Click the interface builder file, Open As -> Source Code
Press Cmd + F to search for "imageView"
Delete the corresponding XML element. For example, you might erase this entire block of text:
<outlet property="imageView" destination="9W1-Bu-YFJ" id="9xu-Y0-uYk"/>
Repeat steps 2-3 as necessary
You're probably missing the #synthesize for imageView.