Hi all, in my QCPlugIn, i'm trying to load a bunch of images (some of you might remember my problem that sending them in as a struct from QC doesn't work).
Some Cocoa magic is afoot here:

NSString *imagePath = [[NSBundle mainBundle] pathForImageResource:@"yes"];

It's great that you're using bundle paths. that's the Right Thing to do in this case.

However, you're using the wrong bundle.  ;)

[NSBundle mainBundle] will _Always_ refer to the running application's bundle (QC in this case, QuickTime if you were loading the composition there, Safari if in a webpage, keynote, whatever, you get the idea). This is completely not what you want (since the file you're looking for is in the plugin's bundle, not the app's bundle).

To get the plugin's bundle, you need to do something like this:

        NSBundle *thisBundle=[NSBundle bundleForClass:[self class]];
        NSString *path=[thisBundle pathForResource:@"yes" ofType:@"png"];

the -bundleForClass:[self class] part should get the bundle that contains the current method's class (the plugin), and then the lookup proceeds as normal.

Developer to Developer: don't be afraid to put NSLog(@"blah")'s _All Over The Place_ with returned values -- this would show the incorrect path, to help narrow down what's going on. :) paths can be tricky like that :)

--
[ christopher wright ]
[EMAIL PROTECTED]
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to