Re: Listening to bindings
Re: Listening to bindings
- Subject: Re: Listening to bindings
- From: Guy English <email@hidden>
- Date: Fri, 18 Feb 2005 11:00:42 -0500
On Fri, 18 Feb 2005 10:46:06 +0000, email@hidden
<email@hidden> wrote:
> Are there notifications I can listen for as they relate to my array?
You can observer the array yourself.
http://developer.apple.com/documentation/Cocoa/Reference/Foundation/ObjC_classic/Protocols/NSKeyValueObserving.html
The plan would be to observe the array and all it's content objects.
On add to the array, start observing the newly added objects (you'll
get a set of 'me in the observe notification method)
On remove from the array, stop observing the removed objects (again,
you'll get a a set)
For each object in the array observe all the keys you're interested in
serializing. You probably want to ask the object you're observing for
a set of keys it serializes and observe those.
My question would be ... why? Is there some reason your model objects
can't manage this themselves? You know when one of your models gets
created ( init ) you know when it gets deleted ( dealloc ) and you
know when it's state changes ( through accessors ). Why do you want a
third party sticking it's nose in there? The only thing I can think of
is that you're using NSDictionaries instead of actual model classes -
if you are: don't. :)
Guy
_______________________________________________
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