• 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
Re: CoreData, Faulting, and KVO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreData, Faulting, and KVO


  • Subject: Re: CoreData, Faulting, and KVO
  • From: Ben Trumbull <email@hidden>
  • Date: Tue, 20 Mar 2007 16:20:08 -0700

Jim,

Your first problem is that NSManagedObjectContext and NSManagedObject do not retain each other. Please see the Core Data Programming Guide and the section titled "Memory Management Using Core Data"

When the last retain on a MOC is released, it invalidates all the managed objects still registered with it. Those objects are pretty useless without a context. This also breaks otherwise intractable retain cycles between related objects.

Your second problem is that all KVO compliant accessors must issue a notification whenever the value changes (pointer equality, not merely -isEqual: equality). So when properties are set to nil, Core Data is required to issue the KVO notifications.

Your KVO observers should handle the case when the value is nil. If nil might be a valid value, you should be able to distinguish circumstances by asking the observed object -isFault

Overriding -willChange... and -didChange... is unsupported.

If you need this supported in future OSX releases you must file a bug report now. <http://bugreport.apple.com>

Email to Cocoa-dev (or any other mailing list or any engineers personally) does not count as a bug report.
--


-Ben
_______________________________________________

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


  • Prev by Date: Re: NSLayoutManager and widows and orphans
  • Next by Date: Re: Webservices in Cocoa
  • Previous by thread: Re: CoreData, Faulting, and KVO
  • Next by thread: Detecting when menubar is visible
  • Index(es):
    • Date
    • Thread