FROM : Randall Meadows
DATE : Thu Feb 28 19:23:52 2008
Responding to my own post, for clarification...
On Feb 28, 2008, at 10:47 AM, Randall Meadows wrote:
> In my main window (which resides in it's own nib, and is controlled
> by a custom window controller), I have a combobox. I'd like to
> populate the contents of that via bindings.
>
> In my main nib file is where the controller lives that maintains the
> information that I want to populate that combobox with. This
> controller has a dictionary ("infoDictionary"), and the keys of that
> dictionary are what I want displayed in the combobox.
>
> My main window class has a member variable (I'm calling this
> "infoController") that is a link to that information controller.
> So, I attempted to set up the binding on the combobox as:
Ok, so I created an NSArrayController object in my window's nib file,
connected that to an outlet in my window class. In awakeFromNib: I
grab the keys from the infoController's infoDictionary, and pass that
to the array controller via addObjects:. It successfully populates my
combobox's content (now I just gotta work on selecting the right one).
Is this the correct way to do this? To me, it seems like a long-
winded route to get there, but then, I think that a LOT about
bindings. Is this just due to my inexperience with bindings? Or do I
just need to keep drinking the kool-aid until it eventually clicks?
(Or, are bindings *really* that roundabout?)
Thanks!
randy
DATE : Thu Feb 28 19:23:52 2008
Responding to my own post, for clarification...
On Feb 28, 2008, at 10:47 AM, Randall Meadows wrote:
> In my main window (which resides in it's own nib, and is controlled
> by a custom window controller), I have a combobox. I'd like to
> populate the contents of that via bindings.
>
> In my main nib file is where the controller lives that maintains the
> information that I want to populate that combobox with. This
> controller has a dictionary ("infoDictionary"), and the keys of that
> dictionary are what I want displayed in the combobox.
>
> My main window class has a member variable (I'm calling this
> "infoController") that is a link to that information controller.
> So, I attempted to set up the binding on the combobox as:
Ok, so I created an NSArrayController object in my window's nib file,
connected that to an outlet in my window class. In awakeFromNib: I
grab the keys from the infoController's infoDictionary, and pass that
to the array controller via addObjects:. It successfully populates my
combobox's content (now I just gotta work on selecting the right one).
Is this the correct way to do this? To me, it seems like a long-
winded route to get there, but then, I think that a LOT about
bindings. Is this just due to my inexperience with bindings? Or do I
just need to keep drinking the kool-aid until it eventually clicks?
(Or, are bindings *really* that roundabout?)
Thanks!
randy
| Related mails | Author | Date |
|---|---|---|
| Randall Meadows | Feb 28, 18:47 | |
| Randall Meadows | Feb 28, 19:23 | |
| Kyle Sluder | Feb 28, 20:41 |






Cocoa mail archive

