|
From: | Fred Kiefer |
Subject: | Re: Problem loading a picture. |
Date: | Fri, 12 Mar 2004 19:41:55 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030821 |
Nicolas SANCHEZ wrote:
in the source code:/NSImage *img = [[NSImage alloc] initWithContentsOfFile: @"CameraTransfer_header.tiff"]];/but somebody helps me to find this (which works):/NSImage *img = [[NSImage alloc] initWithContentsOfFile: [[NSBundle mainBundle] pathForImageResource: @"CameraTransfer_header.tiff"]];/But I think that the first code should works also, shouldn't it ?
I am unsure if the first case should work. But did you try[NSImage imageNamed: @"CameraTransfer_header"]; ? This is the recommended way to load an image from the current bundle. At least I think so. But the second solution is also fine.
Fred
[Prev in Thread] | Current Thread | [Next in Thread] |