0

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 !

al.one
  • 111
  • 2
  • 8
  • IB doesn't delete previously defined and linked outlets. They wind up as "ghost" outlets when deleted in code. Check for those. – CodaFi Mar 07 '13 at 01:57
  • There are none, I can link them again and again, the error is still thrown. – al.one Mar 07 '13 at 02:00
  • Then unload all the outlets and guarantee that. – CodaFi Mar 07 '13 at 02:08
  • Is this for a view controller, or are you building a custom UIView with .h,.m, and .xib files? – Mike D Mar 07 '13 at 02:08
  • please check have you connect view outlet to file owner in .xib file? – kb920 Mar 07 '13 at 04:30
  • This happens when ur presenting view is not connected to any of the objects in ur xib.. – vishy Mar 07 '13 at 05:33
  • @CodaFi Already did that several times. – al.one Mar 07 '13 at 07:46
  • @Mike D I'm building a Custom Subclass of UIViewController : EEMainViewController and in my .xib file, all my components were linked to the outlets I set in the class. – al.one Mar 07 '13 at 07:52
  • @keyurbhalodiya In my initial post, I wrote that I already tried all this stuff. I may check again, but as I said, my outlets are set properly (Because the .xib was doing it's job great till now). – al.one Mar 07 '13 at 07:55

1 Answers1

0

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 !

al.one
  • 111
  • 2
  • 8