• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem saving in a Core Data application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem saving in a Core Data application


  • Subject: Re: Problem saving in a Core Data application
  • From: Paul Johnson <email@hidden>
  • Date: Sat, 13 Nov 2010 15:24:52 -0600

Thank you, Jerry!

So, what I understand is that there are some "race conditions" within Core
Data that make it impossible to specify that a property be required and that
it is necessary to include in one's code any checks for the presence of
values. Now that's interesting. Seems like a deficiency to me. Thanks a lot
for this very important piece of information!

On Sat, Nov 13, 2010 at 2:31 PM, Jerry Krinock <email@hidden> wrote:

>
> On 2010 Nov 13, at 11:29, Paul Johnson wrote:
>
> > <The document "xxx" could not be saved. selectedType is a required value.
>
> Oh, that's good because this error message is much easier to deal with than
> the one in your original post.
>
> Apparently, in you data model you have un-checked the 'Optional' box for
> the property 'selectedType', and either the value has not been set, or, more
> likely, it's being set a few microseconds *after* Core Data checks for it
> and barfs, and the error is therefore a false alarm.
>
> My advice is:  Never un-check any of those 'optional' boxes in a data
> model.  Besides checking too early, these checkboxes, and other validation
> methods built into Core Data, present incomprehensible and embarrassing
> error dialogs like that.  They are OK for in-house work, but not for a
> finished product.  Instead, implement business logic and design your user
> interface so that it is not possible to enter invalid data.  In cases where
> you can't avoid validation, write your own code to detect and recover
> appropriately.
>
>
_______________________________________________

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

  • Follow-Ups:
    • Re: Problem saving in a Core Data application
      • From: Jerry Krinock <email@hidden>
References: 
 >Problem saving in a Core Data application (From: Paul Johnson <email@hidden>)
 >Re: Problem saving in a Core Data application (From: Jerry Krinock <email@hidden>)
 >Re: Problem saving in a Core Data application (From: Paul Johnson <email@hidden>)
 >Re: Problem saving in a Core Data application (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Problem saving in a Core Data application
  • Next by Date: NSConnection memory leak when SSH Tunnelled connection
  • Previous by thread: Re: Problem saving in a Core Data application
  • Next by thread: Re: Problem saving in a Core Data application
  • Index(es):
    • Date
    • Thread