Re: Notification when changes occur to an array?
Re: Notification when changes occur to an array?
- Subject: Re: Notification when changes occur to an array?
- From: Scott Anguish <email@hidden>
- Date: Wed, 27 Sep 2006 11:16:48 -0400
as someone else has pointed out Key-Value Observing is the proper
technique for this.
Have a look at the KVO doc, and also the first item in the Cocoa
Bindings troubleshooting doc. That lists a common gotcha (not adding
items to the array in a KVO/KVC compliant manner)
On Sep 26, 2006, at 10:07 AM, Mattias Arrelid wrote:
Hi everyone,
This is my first post here, so be easy on me. I've searched the
archives and Google without success, so now I ask you for your
expert input.
The problem; I have an NSArrayController with a corresponding
NSArray. I would like some of my other classes to react to changes
to the array, at least when it changes size.
I've read the class reference for both the controller and the array,
but I cannot seem to find any built in notification support for the
array as a whole (like when an element is added, a "sizeHasChanged"
notification should be sent).
I could manually check the size of my array at each instance in my
program where it's needed, but that breaks the notification idea.
_______________________________________________
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