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

Re: NSArrayController - another try


  • Subject: Re: NSArrayController - another try
  • From: Dustin Voss <email@hidden>
  • Date: Thu, 20 Nov 2003 15:45:23 -0800

On 19 Nov, 2003, at 4:20 PM, Dominik Wagner wrote:

Hi List,

Yesterday I started to play around with the Controller Layer, and was overall very pleased. NSObjectController worked as described. You enter the Keys into the Attributes section of the Interface Builder inspector, and connect the content outlet to the corresponding KeyValue Compliant object. Everything gets updated if something is changed. So far so good.
[snip]
My question now is: "hat is the correct way, with least lines of code, to make the NSArrayController Observe the Array? As the array gets all the removeObject and addObject method calls it definetly should now whats happening. So I should not actually be bothered with making my whole model KeyValueCoding compliant. As I read through the threads on this list I found out that the NSArrayController has a binding for the contentArray. So somehow I should marry this with the actual NSMutableArray in my model-object, should I?

Yes, bind it in your awakeFromNib method, like so:

[arrayController bind:@"contentArray" toObject:myArrayOwner withKeyPath:@"myArray" options:nil];

This is basically what IB does.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSArrayController - another try (From: Dominik Wagner <email@hidden>)

  • Prev by Date: Re: Pre-compiled symbol file "Foundation.syms" is out of date
  • Next by Date: Re: Limit NSTextField Size of Input
  • Previous by thread: NSArrayController - another try
  • Next by thread: Adding contextual menues
  • Index(es):
    • Date
    • Thread