• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Bundles as plugins
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Bundles as plugins (From: David Newberry <email@hidden>)

  • Prev by Date: Re: Closing windows bearing sheets
  • Next by Date: Re: Drag types from iTunes
  • Previous by thread: Re: Bundles as plugins
  • Next by thread: Re: Bundles as plugins - Got it
  • Index(es):
    • Date
    • Thread