0

I'm trying to load an image in a NSImageView.

[self.background setImage:[NSImage imageNamed:@"button_selected.png"]];

where background is a NSImageView. The bizarre behavior is that I can't view this image unless I create another NSImageView by InterfaceBuilder and add the same image to it. Yeah, same image in another NSImageView make my programmatically NSImageView work!

Any ideas?!

Ekta Padaliya
  • 5,743
  • 3
  • 39
  • 51
Talkanian
  • 19
  • 1
  • 5
  • Can you show your code here? – Wos Oct 19 '16 at 10:37
  • Nothing very special to add here. I set this Image. If i add another NSImageView via InterfaceBuilder and select the same image: both image are loaded If i don't: my image won't be loaded. Very strange behavior – Talkanian Oct 19 '16 at 10:51
  • if you are programmatically add a UIImageview than you have to add self.view addsubview. – Wos Oct 19 '16 at 10:54
  • sure i did! I repeat that if i add another image, all works fine! – Talkanian Oct 19 '16 at 12:38

0 Answers0