I’ve the following problem:
I’ve added a NSImageView to my NSWindow. I set the controller of my Window as the file’s owner. I can open my window, click on buttons. It works great. But when I try to set an icon to the ImageView, nothing happens because it’s null.
What could be the reason it’s null? I checked, and it’s connected to the IBOutlet.
Thx
Remember, Just connecting to the
IBOutletwill not allocate the memory for given variable. Since you haven’t allocated the memory it shows null.So, do this first.
and then
and then before you set the image you need to
allocandinitthe_imageView.like,