Re: NSArrayController arrangedObjects KVO
Re: NSArrayController arrangedObjects KVO
- Subject: Re: NSArrayController arrangedObjects KVO
- From: Mike Abdullah <email@hidden>
- Date: Sat, 12 Apr 2014 22:18:49 +0100
On 12 Apr 2014, at 21:37, Richard Charles <email@hidden> wrote:
> It is well known in some circles that NSArrayController does not correctly populate the KVO change dictionary.
>
> If you manually observe an array controller’s arranged objects key path with the old and new observation options, the change dictionary you will get when an object is inserted will look like the following:
>
> {
> kind = 1;
> new = "<null>";
> old = "<null>";
> }
>
> http://ddeville.me/2013/10/nsarraycontroller-and-kvo-dependent-keys/
>
> Thats fine, I get that. I do not want or need a populated change dicationary. But what I do need is two notifications, one prior to the change and one after the change.
>
> If you manually observe an array controller's arranged objects key path with the prior observation option, you still only get one notification, after the change has been made. The documentation states the prior option should result in a notification sent prior to the change and a notification sent after the change.
>
> Is there any way to receive a before and after notification for the arrangedObjects property?
You could override -rearrangeObjects to post such a notification perhaps.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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