Compile errors


I’ve tried hard to find the issue associated with this error, but I think I give up. Every time I run the program, it successfully compiles without any issues, but terminates the app with this message:

"*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIApplication 0x6a760a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key answerField.'" Anybody know what this means? Also, this:

   [code]return UIApplicationMain(argc, argv, nil, NSStringFromClass([QuizAppDelegate class]));                                Thread 1: signal SIGABRT[/code]


I am receiving the same errors. It looks like in the errata someone mentions for the first project the iniWithNib function is not being called and the viewDidLoad function is being called instead.

I’d love to follow the book as close as possible. I am using Xcode 4.2.1 if this makes a difference.


Same here. “viewDidLoad” doesn’t fix it. Please Aaron come to the rescue. I’m using Xcode 4.3.2.


Solved (at least for me)! I looked at the connections inspector and saw a loose line saying “answerField” without a connection to anything. I ctrl-draged from answerField (labeled “???”) to File’s Owner so I had two connections from answerField to File’s Owner. Then I deleted one of them using the “x” in the right rectangle. And then the app worked.


It sounds like you typed in everything into the .h file, then connected all of the outlets in the XIB file and then went on to write the code in the .m file. When you were writing the code in the .m file, you realized you spelled one of the instance variables incorrectly and changed it in the .h file. Doing this is okay, but it doesn’t change the connection in a XIB file.

Go into your XIB file and select the File’s Owner. X out any connections that have a yellow warning sign on them. Should work fine after that.


All code and connections look great to me, yet the error persists. I think I’m just going to move on to the next chapters. I’ve got app ideas that I want prototyped before the end of this year and sitting around a program I don’t fully understand yet can’t slow me down! :mrgreen:


Thanks Joe.After reconnecting, It work fine now