Re: Loading nibs in plugins
Re: Loading nibs in plugins
- Subject: Re: Loading nibs in plugins
- From: p3consulting <email@hidden>
- Date: Fri, 20 Feb 2004 18:47:41 +0100
There is no unique reponse to your problem:
it depends from one part on what is your main plugin class:
if it is a descendant of NSWindowController or of something else
(if a NSWindowController you may have to use initWithWindowNibName
instead of init)
and on other part:
when you want the UI to be displayed to the user:
is it at creation time or when the user does something particular to
trigger the interaction (button, menu, )
(you may want to call [NSBundle loadNibNamed:owner:] instead of
initWithWindowNibName)
and
what kind of interaction you want to implement (modal for something
like a configuration window or modeless like a floating palette)
and ...
An immediate responde would be "try initWithWindowNibName instead of
just init"...
(if your plugin class is a NSWindowController subclass or owns a
NSWindowController...)
Pascal Pochet
email@hidden
On 20 fivr. 2004, at 00:39, John Timmer wrote:
>
I've found one or two examples of creating and loading a plugin, but I
>
seem
>
to not be getting something. I'd like to have an object that's got a
>
couple
>
of outlets in a nib file in order to access some interface elements.
>
If I
>
do:
>
>
while ( pluginPath = [pluginEnumerator nextObject] ) {
>
pluginBundle = [NSBundle bundleWithPath: pluginPath];
>
>
if (pluginClass = [pluginBundle principalClass]) {
>
if ([pluginClass conformsToProtocol:@protocol(myProtocol)]
>
) {
>
aPlugin = [[pluginClass alloc] init];
>
}
>
}
>
>
I do get a valid object with the appropriate structure, so I know that
>
the
>
bundle and class are working properly. The problem seems to be that
>
the
>
alloc/init combination doesn't hook up the outlets within the nib
>
(they're
>
set to 0). Given that, what do I use to to initialize one of these
>
objects
>
while properly hooking up the nib outlets?
>
>
Any help would be appreciated.
>
>
Cheers,
>
>
John
>
_______________________________________________
>
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.
_______________________________________________
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.