I would like to display an NSImageView
in my main View:
img=[[NSImageView alloc]init];
[img setImage:[[NSImage alloc]initWithContentsOfFile:filename]];
width=img.image.size.width/2;
height=img.image.size.height/2;
[img setFrame:NSMakeRect(0,0,width ,height)];
mainview = [((AppDelegate *)[NSApp delegate]).window contentView];
[mainview addSubview:img];
The image is properly displayed, however instead of being in the top-left corner of my main window, it's completely going to the right side of the screen.
What is wrong above?