Re: NSPopUpButton again
Re: NSPopUpButton again
- Subject: Re: NSPopUpButton again
- From: Johnny Lundy <email@hidden>
- Date: Fri, 9 May 2008 11:09:47 -0400
On May 9, 2008, at 12:52 AM, Ken Thomases wrote:
It seemed to me that I wasn't allowed to bind a View item's (the
NSPopUpButton) property directly to a model object's
(popup.selectedGame) property. But I do not see any way to use the
controller here to communicate with a property in the Model, except
to get its Content from the Model, which works fine.
See this for Apple's advice on the subject:
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/WhatAreBindings.html#/
/apple_ref/doc/uid/20002372-177085
Right - I have read that until I almost have it memorized, but they
always leave out the details, such as the Combatant having 3 instance
variables for weapons, and yet referring to the selection of the
weapons. I think what they mean is that you would have multiple
instantiations of this class, and the aggregate of those instances
make up the collection. But there of course is no code illustrating
that.
So, what you might want to do is create an NSObjectController to
mediate bindings to the instance of the Popup class. But that's not
strictly necessary.
That is what I intend to explore - to see if I can avoid having the
View communicate directly with the Model. I still don't get why there
is no selectedObject binding in the arrayController - there is nothing
to bind the Model object to. All I see on my arrayController's
Bindings pane is the Content bindings and one that is labeled
Selection Indexes. If it had a Selected Object, I could bind that to
my Model object and be done. I thought array controllers had to have a
selection binding.
I have Aaron's third edition on order, having already worn out the
first two editions. Maybe that will nail down the details of what each
of these bindings means.
Regards, Johnny
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden