On Feb 25, 2009, at 2:24 PM, Quincey Morris wrote:

On Feb 25, 2009, at 05:31, Jerry Krinock wrote:

On 2009 Feb 24, at 20:02, Dave Fernandes wrote:

... I'm only just getting familiar with the idiosyncrasies of Leopard, however, in Tiger didTurnIntoFault might be called many times, but awakeFromInsert or awakeFromFetch was only called once for the lifetime of the MOC (not the lifetime of the object). Thus, if you delete the object, and then undo that action, your observers will be removed by didTurnIntoFault and not added back since awakeFromFetch is not called again.


Dave's earlier comment on this contains some assumptions that are suspect. I don't know of any guarantee that deleting an object causes the object to first be faulted out and/or to receive a 'didTurnIntoFault' message, but perhaps it's so, or perhaps it's a current implementation detail that can't be relied on in the future.

I haven't seen this documented either, so I assumed it might be implementation dependent. That is why I restricted my comment to the version of the OS that I have tested on. It is quite possible that others will observe different outcomes. I can only describe what I have seen in my app.

Further, I wouldn't expect 'awakeFromFetch' to be called as a result of undo. I might expect 'awakeFromInsert' to be called as a result of undoing a deletion, but, given Core Data undo's overall inscrutability, it's possible that it just restores the previous MOC state directly, without invoking the various supporting "notification" methods. (Undo does, for example, restore the values of transient properties, so *that* reason for needing some kind of 'awakeFrom...' is obviated.)



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to