Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
- Subject: Re: CoreData - re-faulting object and removing self-observers results in messages being sent to zombie
- From: Melissa Turner <email@hidden>
- Date: Thu, 4 Aug 2005 12:17:38 -0700
On Aug 3, 2005, at 18:29, Jim Correia wrote:
On Aug 3, 2005, at 5:31 PM, Frank Illenberger wrote:
1. willChangeValueForKey/didChangeValueForKey are only called
when there is actually some object obeserving the key. This is an
optimization new to Tiger. In Panther, these methods were called
even when there was no one observing. So this is not a good place
to hook in.
Frank,
Is this documented someplace? Is it true even for subclasses of
NSManagedObject?
<code snip>
didChangeValueForKey is called for magicAttribute even though there
are no observers (or UI objects bound to that key.)
The managed object context always registers itself as an observer of
any managed objects that have been inserted or fetched into it; this
is how it does faulting, change tracking and relationship management,
and why your accessor methods always need to invoke will/
didAccessValueForKey and will/didChangeValueForKey.
Thus, managed objects will always post will/didChangeValueForKey
notifications. (Unless you passed nil to the factory or initializer
method for the managed object context parameter, but you're good
programmers and don't do that kind of thing, right?)
+Melissa
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden