`

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)

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics