IKImageView properties not being set in Interface Builder

316 Views Asked by At

I have a IKImageView in Interface Builder and have set the background color to red but it doesn't work when the app is run, it just stays gray.

  1. I created a brand new Cocoa (OS X) project in Xcode 4.5 with the Cocoa Application template.
  2. Added the Quartz framework
  3. Dragged an IKIMageView from the Object library onto my window.
  4. Change the color to red.

Screenshot

2

There are 2 best solutions below

0
On

I set background color by this:

_imageView.backgroundColor = [NSColor redColor];

where _imageView is set as IBOutlet IKImageView * _imageView;

0
On

There is a bug in IKImageView.

Better Workaround: Use setImageWithURL: with nil as a parameter and CALayers will be constructed also do not name any method of custom IKImageView as -(void)commonInit