• 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
NSArrayController usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController usage


  • Subject: NSArrayController usage
  • From: Pierre Chatel <email@hidden>
  • Date: Mon, 23 May 2005 00:14:45 -0300

Hi everybody,

i'm trying to port portions of my code to use cocoa bindings: more specifically, NSArrayControllers.
But i've made an afflicting discovery: an array controller is not aware of changes made to the array programmatically (i mean, adding or removing objects of the array in your code for example) !
Shouldn't it be a default behavior of NSArrayController ?!
I guess i'll have to subclass the controller class or register for some events...

How would *you* do that ? ;-)

PS: maybe it's a silly question, but i've come across the same problem at  CocoaDev http://www.cocoadev.com/index.pl?NSArrayController. Here is an extract:

"Question: if I have an array in the model and I want it to be displayed in an NSTableView, but items can be added to the array from other places than the GUI, is an NSArrayController the right solution? cause if I add items to the array (from another source), they will not show in the NSTableView, unless I issue a will/didChangeValueForKey: with my actual array being the key. I.e. if my NSTableView is set to display "arrangedObjects.name" shouldn't that then trigger a notify, when new items are added to the array?

You can call [ myView reloadData ]; to update the display

No, because the model which change the array do not know who is currently showing that array in the GUI -- it should happen automatically thru bindings..."



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSArrayController usage
      • From: Lee Morgan <email@hidden>
  • Prev by Date: RE: "Reveal Drawer" button in title bars
  • Next by Date: Re: "Reveal Drawer" button in title bars
  • Previous by thread: Re: Subclassing NSManagedObject issue
  • Next by thread: Re: NSArrayController usage
  • Index(es):
    • Date
    • Thread