On Fri, 12 Mar 2004 18:26:55 +0100 Nicolas SANCHEZ <[EMAIL PROTECTED]> wrote: [...] > in the source code: > NSImage *img = [[NSImage alloc] initWithContentsOfFile: > @"CameraTransfer_header.tiff"]];
This will try to init NSImage with the content of a file that resides in the current directory (ie. the directory you start the application from) Because CameraTransfer_header.tiff resides directly in your source directory, the image will be loaded and NSImage is created. > but somebody helps me to find this (which works): > NSImage *img = [[NSImage alloc] initWithContentsOfFile: [[NSBundle > mainBundle] pathForImageResource: @"CameraTransfer_header.tiff"]]; This works, because -pathForImageResource: looks at what is specified 'under' CameraTransfer_RESOURCE_FILES in your GNUmakefile. The tiff is copied into YourApplication.app/Resources and the above statement will load the tiff from there... A 'shortcut' would be NSImage *img = nil; img = [NSImage imageNamed: @"CameraTransfer_header.tiff"]; > But I think that the first code should works also, shouldn't it ? It should not and cannot. -- Chris _______________________________________________ Help-gnustep mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/help-gnustep
