Re: KVO and Core data
Re: KVO and Core data
- Subject: Re: KVO and Core data
- From: Dave Fernandes <email@hidden>
- Date: Mon, 9 Aug 2010 16:13:45 -0400
On 2010-08-09, at 12:57 PM, Quincey Morris wrote:
>> On 10/08/2010, at 12:20 AM, Keary Suska wrote:
>>
>>>
>>> The trace shows that the destination has been invalidated before your object is faulted, and so the exception is raised when it tries to remove observation. Invalidated object references should be rare--I would expect Core Data to "clean up" relationships when a MOC is reset but that does not appear to be the case (at least not all the time). Have you re-looked at the issues around the question you asked back in April:http://www.cocoabuilder.com/archive/cocoa/284398-invalidated-managed-objects.html ?
>
> But you haven't addressed Keary's excellent point that the problem is not with faulting, but with the observed object being invalidated (apparently). If faulting an observed object caused a crash, then I don't see how Core Data could work at all.
>
> Similarly, keyPathsForValuesAffecting<Key> seems like a red herring. It uses observation internally (perhaps setting it up via a fast path not available to applications), so it doesn't really change the picture.
I have no idea how keyPathsForValuesAffecting<Key> works under the hood, but it automagically handles setting up and tearing down observers when a MOC is reset, released, etc. So these kinds of problems simply don't happen. It's really the easy way to do it (unless you have to support Tiger).
Dave_______________________________________________
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