Re: Adding an image to a project
Re: Adding an image to a project
- Subject: Re: Adding an image to a project
- From: Ron Fleckner <email@hidden>
- Date: Thu, 15 Jul 2010 18:43:49 +1000
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 <email@hidden> ha scritto:
>
> Da: Ron Fleckner <email@hidden>
> Oggetto: Re: Adding an image to a project
> A: "Vincenzo Morgante" <email@hidden>
> Cc: email@hidden
> 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 (email@hidden)
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:
This email sent to email@hidden