I used [NSBundle bundleForClass:[self class]]...
And now the plugin works without any problems!!!
Thanks!
Vincenzo


--- Ven 16/7/10, B.J. Buchalter <b...@mhlabs.com> ha scritto:

Da: B.J. Buchalter <b...@mhlabs.com>
Oggetto: Re: Adding an image to a project
A: "Vincenzo Morgante" <enzo...@yahoo.it>
Cc: "Cocoa Development" <cocoa-dev@lists.apple.com>
Data: Venerdì 16 luglio 2010, 00:26


On Jul 15, 2010, at 6:17 PM, Vincenzo Morgante wrote:

> Since 
> the plugin still does not work on my system, I'll try to create a new 
> project following again the wizard for the development of 
> plug-in for OsiriX. After 
> all, it works on another system...

If you are creating a plugin (rather than an application), you need to be 
careful to use the right NSBundle calls to refer to your plug-in's bundle and 
not the bundle of the Application that loads your plugin. That may be the 
source of the problem for you.

In particular, if your resource is in your plug-in's bundle and your plugin is 
loaded by a hosting application, the [NSBundle mainBundle] call refers to the 
bundle of the hosting application, and not your plugin's bundle.

You want to use [NSBundle bundleForClass: <one of your plugin's classes>] or 
[NSBundle bundleWithIdentifier:@"your.plugins.bundle.id"]

Hope that helps.

Best regards,

B.J. Buchalter
Metric Halo 
http://www.mhlabs.com
    






_______________________________________________

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