Re: Bundles as plugins
Re: Bundles as plugins
- Subject: Re: Bundles as plugins
- From: Nicholas Shanks <email@hidden>
- Date: Mon, 4 Mar 2002 23:07:11 +0000
On Sunday, March 3, 2002, at 04:57 am, David Newberry wrote:
Hum...
I have an app which does this:
@implementation ClassInHostApp
- (void)someFunction
{
NSBundle *plugin = [NSBundle bundleWithPath:[[[NSBundle mainBundle]
builtInPlugInsPath] stringByAppendingPathComponent:@"MyPlugin.plugin"]];
[[[plugin principalClass] alloc] init];
}
@end
@implementation PluginWindowController
- (id)init
{
self = [self initWithWindowNibName:@"AnyNibFile"];
if( !self ) return self;
// load the window from the nib file
[self window];
return self;
}
@end
Note: The plug-in's principal class (as noted in the Target setting in PB)
must be an NSWindowController subclass for this to work. (And the nib
file's owner must be that same class too.)
My app has a bug whereby when the window is closed, the window controller
is not disposed of, it just leaks. If anyone could tell me the proper way
to kill it, I'd be most grateful.
Nicholas Shanks
--
http://nickshanks.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.