Re: Access to localized images in a plug-in
Re: Access to localized images in a plug-in
- Subject: Re: Access to localized images in a plug-in
- From: Gregory Weston <email@hidden>
- Date: Sat, 16 Jun 2007 13:40:39 -0400
Steve Weller wrote:
But it no longer works because the folder structure has changed. I
would use - (NSString *)pathForResource:(NSString *)name ofType:
(NSString *)extension inDirectory:(NSString *)subpath
Actually just pathForResource:ofType would be the right way to do it.
with subpath set to nil but there is no place to specify the bundle
to use.
The bundle to use is the bundle object to which you send the message.
In my case I cannot use the main bundle because that belongs
to Aperture. I need a version of this that allows me to choose the
bundle. Does such a method exist, or do I need to roll my own?
And the way to find the right bundle for a plugin is to use
NSBundle's bundleForClass: or bundleWithIdentifier: methods.
Actually, looking back over your code, I see...
NSString *noThumbPath = [[_bundle resourcePath]
stringByAppendingPathComponent:@"NoImage.tiff"];
...and find myself wondering where you got the thing called _bundle
from. It looks like you've already gotten your plugin's bundle, yes?
G
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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