Has you been added the image in GNUmakefile? Something like: YourApp_RESOURCE_FILES = \ Resources/myImage.png
El dom, 02-09-2012 a las 21:07 +0000, Steve Van Voorst escribió: > I am unable to get the following code to place an image in an > NSImageView. OS = Ubuntu 12.04. > > NSImageView *imageView = [[NSImageView alloc] > initWithFrame:NSMakeRect( 30, 130, 100, 100 )]; > [[window contentView] addSubview:imageView]; > NSImage *image = [NSImage imageNamed:@"myImage.png"]; > [imageView setImageScaling:NSScaleToFit]; > [imageView setImage:image]; > [imageView release]; > > I have placed the image in the same folder as the source code. > Specifically, I am unable to generate the image object; it returns > null. > > I unsuccessfully tried -initWithContentsOfFile:, placing the image in > the Resources folder, and using a .jpg instead of a .png. Still no > image. I would appreciate any help. Thanks. > > Steve Van Voorst > _______________________________________________ > Discuss-gnustep mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/discuss-gnustep _______________________________________________ Discuss-gnustep mailing list [email protected] https://lists.gnu.org/mailman/listinfo/discuss-gnustep
