Re: Finding "myself" in a plugin architecture
Re: Finding "myself" in a plugin architecture
- Subject: Re: Finding "myself" in a plugin architecture
- From: Keith Duncan <email@hidden>
- Date: Wed, 21 Feb 2007 04:38:36 +0000
I don't know the intrinsics of your plugin architecture but one of
the ways I do it is to provide an abstract superclass.
That way I can make the designated initializer (much like
NSPreferencePane does) -(id)initWithBundle:(NSBundle *)bundle . This
allows the subclass to get a handle on the bundle it was init'd from
if it wants to.
- Keith
On 20 Feb 2007, at 14:44, R. Tyler Ballance wrote:
I'm following the Code Loading Programming Topics guide to work on
implementing a relatively basic plugin architecture for an
application of mine. The one thing that I "can't" seem to do is
"find myself" from the plugin's perspective.
Insofar as [NSBundle mainBundle] will return the main application
bundle. Is there a way that I'm missing that I can find "my" bundle
from inside the plugin's code itself? So I can access my own
Info.plist file, among other things. Any ideas?
While I could use [NSBundle bundleWithIdentifier] that's a bit too
case-centric in that this "dumb" bit of code would have to know
what the identifier of the bundle is that it's being loaded in is,
as opposed to using reflection (eeek) and discovering this at runtime.
Cheers
R. Tyler Ballance: Lead Mac Developer at bleep. software
contact: email@hidden | jabber: email@hidden
_______________________________________________
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