One last amateurish wild guess: does Xcode list the image along with all your 
source files and other files which are part of your project in the pane above 
the editor when you select the Target or Project icon in the Groups & Files 
list?  Does it list your image file in the Resources folder icon in the Groups 
& Files list?  If not, then the file is not actually added to the project.  If 
it is listed, then there's something very unusual about your project.  [NSImage 
imageNamed:@"report"] should Just Work™ as should the NSBundle method you 
showed.

???

Ron


On 15/07/2010, at 6:12 PM, Vincenzo Morgante wrote:

> Right-click on the Resources folder in Xcode's files pane on left and choose 
> "Add Existing files..." from the menu.
> Then I selected the option "Copy..." in order to copy the image from the 
> source folder.
> 
> Vincenzo
> 
> --- Gio 15/7/10, Ron Fleckner <ronfleck...@ozemail.com.au> ha scritto:
> 
> Da: Ron Fleckner <ronfleck...@ozemail.com.au>
> Oggetto: Re: Adding an image to a project
> A: "Vincenzo Morgante" <enzo...@yahoo.it>
> Cc: cocoa-dev@lists.apple.com
> Data: Giovedì 15 luglio 2010, 09:42
> 
> 
> On 15/07/2010, at 5:18 PM, Vincenzo Morgante wrote:
> 
> > The path for resource is not displayed because the object 'imageName' is 
> > nil.Why this object is nil?I added the file "report.png" to the folder 
> > Resources of my project:
> 
> Hello Vincenzo,
> 
> just a wild guess from an amateur:  Did you just physically drag the image 
> file into your project's folder in the Finder? I don't think that will be 
> successful. I think you need to add it to your project via Xcode.  
> Right-click on the Resources folder in Xcode's files pane on left and choose 
> "Add Existing files..." from the menu.
> 
> Ron
> 
> 

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to