Re: Causes of "Cannot update object that was never inserted"
Re: Causes of "Cannot update object that was never inserted"
- Subject: Re: Causes of "Cannot update object that was never inserted"
- From: Michael Crawford <email@hidden>
- Date: Mon, 17 Jun 2013 00:17:45 -0700
Try adding assertions throughout your code.
I get the most mileage by validating the input parameters to all my
subroutines. If one of your parameters is a pointer, can it be nil?
Less commonly I validate return results and side effects.
Also look through all of your subclass method overrides, to check
whether you called the superclass' method. I fixed some really weird
bugs in my iOS App when I added such calls where they were needed.
It's documented that you generally need to do this, but if you forget,
generally nothing really obvious happens other than some mysterious -
and apparently unrelated - behavior.
Enable Guard Malloc. There is some problem with that, either on
Mountain Lion or the current Xcode, but the fix for it was posted to
one of Apple's lists a few months ago.
Since you're working on an OS X App, you can also try Valgrind. It's
far more rigorous than Guard Malloc. http://www.valgrind.org/
Mike
email@hidden
On Sun, Jun 16, 2013 at 10:43 PM, Jerry Krinock <email@hidden> wrote:
>
> On 2013 Jun 16, at 22:22, Julian Richardson <email@hidden> wrote:
>
>> I believe that ALAssetLibrary uses Core Data, so the problem could be a user's messed up image library.
>
> Thank you, Julian. I don't think that's the problem here. The error logged indicates that the object's entity is one of "my" entities. All but one of its attributes are nil/default. The non-nil attribute is its "name" = "untitled", which gets assigned within a few code-lines after insertion. You may have kicked me in an interesting direction.
>
> Also, I should have said that this app is OS X.
>
>
> _______________________________________________
>
> 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
--
Michael David Crawford
mdcrawford at gmail dot com
Custom Software Development for the iPhone and Mac OS X
http://www.dulcineatech.com/custom-software-development/
_______________________________________________
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