6

I am new to ObjC. Thanks in advance for your help and patience!

I'm trying to add an image to a window in my app (This is OSX, not iOS). I added an Image View (IKImageView) via interface builder to the window. I then added my image to the XCode Project and assigned it to the view.

When I try to compile the app it crashes with the error: "cannot decode object of class (IKImageView)".

The moment I delete the IKImageView it compiles just fine.

My initial thought was that I wasn't importing the required file, but this appears to be a subclass of NSView, so that shouldn't be the problem.

Any thoughts as to what I'm doing wrong?

Matthew Jones
  • 197
  • 1
  • 10
  • 2
    Disregard. You have to include the Quartz framework for IKImageView to work. – Matthew Jones Mar 31 '12 at 01:44
  • When you try to compile it, or when you try to run it? I'd expect that message to come from the nib loader at run time. Either way, adding imports isn't the solution because the message concerns a nib (where you created the IKImageView it can't decode), and you put imports in your code, not your nibs. – Peter Hosey Apr 09 '13 at 03:13

1 Answers1

12
  1. Select the project on the left side of Xcode.
  2. You will see the "summary" tab on the right side. Select it.
  3. Add Quartz.framework into "Linked Frameworks and Libraries".
Peter Hosey
  • 95,783
  • 15
  • 211
  • 370
f91kdash
  • 328
  • 2
  • 7