Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switching NSArrayControllers around




On Mar 20, 2007, at 8:06 PM, Knud Hinnerk Möller wrote:

Hi,

I have two NSArrayControllers and and NSTableColumn. Depending on some other factors (what is selected in another table), I want to change which of the controllers is shown in the table. So far I'm doing this by changing the bindings of the table column. That works fine, but it is a little messy, because there are actually also other UI elements that need to be changed accordingly (add and remove buttons for the table, textfields that display details of the table selection, ...). I currently have to change bindings for five different UI elements each time.

My understanding of NSArrayController (or any NSController) is that it shields the view(UI) from changes in objects in the model. So no rebinding to model objects are needed by the view layer. So you would be better off change the content of a single NSArrayController and let it do the the job it was meant to do in rebinding the changing objects. Changing out the NSArrayControllers is messy because your working with with them in a way they are not designed to work, and in the process rewriting code already written for you by the controllers.




Regards,
Brian Smith
http://www.suaveware.com



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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/email@hidden

This email sent to email@hidden
References: 
 >Switching NSArrayControllers around (From: Knud Hinnerk Möller <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.