Re: NSArrayController - another try
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.