Bindings vs MOC change notification
Bindings vs MOC change notification
- Subject: Bindings vs MOC change notification
- From: David Catmull <email@hidden>
- Date: Fri, 13 Nov 2009 18:11:34 -0800
In my Core Data app, I have objects with a date property, and I want to maintain a list of all years that I have objects in. I'm having trouble settling on an approach.
Currently, I'm listening for NSManagedObjectContextObjectsDidChangeNotification. This is working fine for additions and deletions, but it's harder for changes, mainly because I don't know the old value. If I did, I could check if the old year still has any other objects in it. As it is I have to refresh the whole list. I also get more notifications than I need, since I only care about date changes on this one entity.
Another option is to use KVO so I can be notified only of date changes. I'm assuming that registering as an observer for potentially thousands of Core Data objects doesn't carry too much overhead. The down side is that if lots of objects change at once, I get lots of individual callbacks, and I worry that that would be a bottleneck.
Recommendations? Other options?
Thanks,
--
David Catmull
email@hidden
http://www.uncommonplace.com/
_______________________________________________
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