Hi all

Thanks to all of you for your answers. Mark just found the source of my problem 
and I want to publish it since it may help some more people that have that kind 
of issues, even if I at the same time expose my ignorance of some basic 
knowledge but hey, that's learning.

My Core Data objects have implementation classes. One of those class had a 
dealloc implemented and this guy was freeing a reference to a member of UIColor 
type. That was the source of the problem, all those errors on accessing a 
faulty object occured while deallocating it. And the real source as of why I 
was not able to spot it: Since all this occurs after all your code is done and 
because I didn't knew about the Break on exception On Throw... 

All this time spent of re-re-reading and solidifying code still did a lot of 
good :).

Thanks again, and for all those Core Data apprentices out there, don't forget 
to always forget to implement dealloc ;). CD is doing a good job in 
housekeeping.


Eric.


On 2012-03-01, at 09:12, Eric Giguere wrote:

> Hi all
> I'm on the verge of loosing my sanity... I've been running after save bugs 
> and I'm now completely out of ideas, other than to drop Core Data.
> 
> In my model, I have EntityA, wich has an 1-many relationship to EntityB, 
> which also have a 1-many relationship to EntityC.
> Both relationship are bi-directionnal, and I'm using cascade delete from A to 
> C.
> 
> The only object in that chain that seems to be deletable is EntityB.
> As soon as I try to delete an object from EntityC (A -> B -> C), I get this 
> error:
> Terminating app due to uncaught exception 'NSObjectInaccessibleException', 
> reason: 'CoreData could not fulfill a fault for
> 
> I've been hitting this error for a long time now. I've read that it may be 
> because I may have a reference in my code to the object that get deleted. So 
> I cleaned up everything, nothing does.
> So out of despair, I've created a small method in my main window that creates 
> a new tree of object (A contain 1 B, contains 1 C) and try to delete C. No 
> references anywhere here.
> 
> If I try deleting the C object before saving the new stuff, I get this error:
> Domain=NSCocoaErrorDomain Code=134030 "The operation couldn’t be completed. 
> (Cocoa error 134030.)
> NSUnderlyingException = "Cannot update object that was never inserted.";
> 
> And if I save, then delete then save again I get back to the 
> NSObjectInaccessibleException.
> 
> 
> Anybody, please, if you have a pointer so that I could find and fix this 
> error... It does not make sense that such a library fails with such a trivial 
> case.
> I must be doing something wrong, but I've re-re-re check everything and don't 
> see.
> 
> I've played with the reverse relationship delete rules, made all of the 
> optional, put them to nil before saving, nothing does :(
> 
> I really don't know what to do next.
> 
> Thanks for any help!
> 
> Eri
> 
> 
> 
> 
> _______________________________________________
> 
> 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:
> https://lists.apple.com/mailman/options/cocoa-dev/eric.giguere%40videotron.ca
> 
> This email sent to eric.gigu...@videotron.ca

Eric Giguere
eric.gigu...@videotron.ca



Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

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

Reply via email to