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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to