Is there some kind of multi-NIB delegate pass-through?
Is there some kind of multi-NIB delegate pass-through?
- Subject: Is there some kind of multi-NIB delegate pass-through?
- From: Adam Knight <email@hidden>
- Date: Sun, 21 Aug 2005 15:27:58 -0500
I have an NSPersistentDocument with many items in a list and an
editing area. I have, in MainMenu.nib, an info window setup with
bindings to the frontmost window using the very-long-keypath trick.
Works great.
I want to add an NSTokenField to the info window. For various
reasons, bindings are not the answer to this (namely, auto-complete
and object association -- this will be used to manage a to-many
relationship). So I know I need to use the delegate methods for the
object, but with the window in the MainMenu NIB and the document
"elsewhere" what is the best way of setting it up such that the
delegate calls from the info window make it to the front document?
The only solution I can think of would to to setup calls in the
controller such that:
-(NSArray *)tokenFieldCell:(NSTokenFieldCell *)tokenFieldCell
completionsForSubstring:(NSString *)substring indexOfToken:(int)
tokenIndex indexOfSelectedItem:(int *)selectedIndex
{
return [[[[self mainWindow] windowController] document]
tokenFieldCell:tokenFieldCell completionsForSubstring:substring
indexOfToken:tokenIndex indexOfSelectedItem:selectedIndex];
}
This, however, seems like a royal pain. Are there other, better
solutions, like making all calls to "tokenFieldCell.*" pass-through
automatically? Is it reasonable to change the delegate of the object
on main window changes?
Adam Knight
will bug code for food
http://www.codepoetry.net/
I ♥ my
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden