• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Switching NSArrayControllers around
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switching NSArrayControllers around


  • Subject: Re: Switching NSArrayControllers around
  • From: Brian Smith <email@hidden>
  • Date: Wed, 21 Mar 2007 09:20:27 +0800


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:
This email sent to email@hidden


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

  • Prev by Date: Re: performSelectorOnMainThread & NSEventTrackingRunLoopMode
  • Next by Date: NSImage lockFocus throws exception?
  • Previous by thread: Switching NSArrayControllers around
  • Next by thread: Webservices in Cocoa
  • Index(es):
    • Date
    • Thread