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: Mike Abdullah <email@hidden>
- Date: Tue, 26 Sep 2006 17:00:14 +0100
It sounds like you don't want a notification really. Use Key Value
Observing instead. That will tell you when an item is added or
removed from the array, and even what the new/old objects are.
Alternatively, you could subclass NSArrayController to issue a
notification, but this seems messier.
Mike.
On 26 Sep 2006, at 15:07, 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.
Thanks in advance.
/ Mattias
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com
This email sent to email@hidden
_______________________________________________
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