• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Bindings vs MOC change notification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Bindings vs MOC change notification
      • From: "email@hidden" <email@hidden>
    • Re: Bindings vs MOC change notification
      • From: Kyle Sluder <email@hidden>
    • Re: Bindings vs MOC change notification
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: Auto-scrolling view
  • Next by Date: Core Data: Begin+End Undo Group = Dirty Dot. Why?
  • Previous by thread: Derived Value and Core Data
  • Next by thread: Re: Bindings vs MOC change notification
  • Index(es):
    • Date
    • Thread