Re: Adding an image to a project
Re: Adding an image to a project
- Subject: Re: Adding an image to a project
- From: Vincenzo Morgante <email@hidden>
- Date: Thu, 15 Jul 2010 07:18:40 +0000 (GMT)
You're right, but unfortunately the project deadline is near: after all, the goal of this university project on computer vision is another and therefore we prefer to concentrate on the real goal of the project.The image that we can not load should be used to display a simple report containing the results, so reluctantly I'd be happy even pixel by pixel copy from a NSImage object to an object IplImage.However, perhaps I understand the problem...
NSString* imageName = [[NSBundle mainBundle] pathForResource:@"report" ofType:@"png"];if(imageName) { // print the path for resource}
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: I will check whether the image is actually into WhateverApp.app/Contents/Resources/
Thanks a lot!
Vincenzo
--- Gio 15/7/10, Graham Cox <email@hidden> ha scritto:
Da: Graham Cox <email@hidden>
Oggetto: Re: Adding an image to a project
A: "Vincenzo Morgante" <email@hidden>
Cc: email@hidden
Data: Giovedì 15 luglio 2010, 01:49
On 15/07/2010, at 3:01 AM, Vincenzo Morgante wrote:
> I wrote the following code, but it does not work: the program crashes...
> Maybe the only solution is a copy pixel by pixel...
Code never crashes for no reason. And you have tools which will explain the reason, in excruciating detail if you want it, so find the problem and fix it. Why give up at the first whiff of trouble when the approach you're taking is basically right, and assume the solution must obtain by a ridiculously more complex and slow method?
--Graham
_______________________________________________
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