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 protected]> 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 protected]) 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 [email protected]
