0

I am writing a very simple app with just one view controller. However I am getting an exception:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key

Here is what I did:

  1. added a UIImageView and created an outlet in the code by ctrl-dragging to the assistant editor.
  2. deleted the UIImageView cause I don't need
  3. deleted the outlet property from the code
  4. checked the connection inspector and removed the outlet from the storyboard/InterfaceBuilder.

But I am still getting the exception as listed above, could anyone give me some hints?

t0mppa
  • 3,983
  • 5
  • 37
  • 48
wizoleliam
  • 83
  • 3
  • 13
  • Storyboards / xib files don't always get updated in the compiled binaries when building new versions in Xcode. Try doing a full *clean* before rebuilding and see if you have better luck. – Michael Dautermann Feb 16 '14 at 09:20

1 Answers1

0

Usually you should do a clean of your project, found in the Project menu next to build That way xib files get recreated and often such errors disappear.

Volker
  • 4,640
  • 1
  • 23
  • 31
  • 1
    Thank you @Volker, it worked. It turned out to be cache issue. Here is an another thread discussing cleaning in more details: http://stackoverflow.com/questions/5714372/how-to-empty-caches-and-clean-all-targets-xcode-4 – wizoleliam Feb 16 '14 at 10:01