Re: How is a bound NSArrayController so stealthy?
Re: How is a bound NSArrayController so stealthy?
- Subject: Re: How is a bound NSArrayController so stealthy?
- From: Keary Suska <email@hidden>
- Date: Tue, 05 Jun 2007 13:10:08 -0600
- Thread-topic: How is a bound NSArrayController so stealthy?
on 6/5/07 12:38 PM, email@hidden purportedly said:
> How is NSArrayController able to change the model to which it is
> bound so stealthily? I suppose it could be modifying the instance
> variable directly a la myDocument->toDos?
No stealth involved. When you edit a cell of a tableview, you are editing
the object that represents the row--most commonly an NSDictionary. You are
not editing the array, so none of the array accessors will be called.
> If so, how can I be notified? I tried adding self as an observer to key path
> toDos, but observeValueForKeyPath:ofObject:change:context: does not get
> invoked when I edit an existing table item.
You need to observe the object that is changing. If you have an NSArray of
NSDicitonaries, you want to observe the dictionaries, not the array. The
array doesn't know that its contained objects are changing. It's not its
business.
Best,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden