FAQ: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reas

FAQ: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key itemName.' (permalink )

答案:

If you're using NIB files / Interface Builder, what this error message REALLY means is:

"Your NIB file has a GUI element that's connected (via the Outlets screen) to an outlet in one of your source files that doesn't exist"

i.e. it usually happens when you change the name of an IBOutlet variable in your source file, and forget to change your NIB file to reflect the change.

(sadly, Interface Builder isn't good enough to automatically rename the connection, as it is supposed to do - you MUST do it manually)

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章