• 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: Core Data Validation Ignored?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data Validation Ignored?


  • Subject: Re: Core Data Validation Ignored?
  • From: Quincey Morris <email@hidden>
  • Date: Tue, 19 Feb 2008 22:30:48 -0800


On Feb 19, 2008, at 21:28, Andrew Merenbach wrote:

Despite my searches through the documentation (and despite my possible incorrectness in assuming that the validation-method generator will do what I want), I have found no way to get the table view to validate properly. Furthermore, making a - (BOOL)validateMyTitleAttribute:(id *)ioValue error:(NSError **)outError in my NSManagedObject subclass does absolutely nothing.

Actually, the section on validation in the Core Data Programming Guide seems pretty clear. For example:


It is important to understand that how to validate is a model decision, when to validate is a user interface or controller-level decision (for example, a value binding for a text field might have its “validates immediately” option enabled). Moreover, at various times, inconsistencies are expected to arise in managed objects and object graphs.

There is nothing to disallow an in-memory object from becoming inconsistent on a temporary basis. The validation constraints are applied by Core Data only during a “save” operation or upon request (you can invoke the validation methods directly as and when you wish).



I suspect you just need to turn on the "validates immediately" option in your bindings in IB. You shouldn't need to write validate<Key> methods for your properties unless you need additional customized validation.

_______________________________________________

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: Core Data Validation Ignored?
      • From: Andrew Merenbach <email@hidden>
References: 
 >Core Data Validation Ignored? (From: Andrew Merenbach <email@hidden>)

  • Prev by Date: Re: How to set NSTextFieldCell as firstResponder - Solved
  • Next by Date: Re: A window that rejects focus
  • Previous by thread: Re: Core Data Validation Ignored?
  • Next by thread: Re: Core Data Validation Ignored?
  • Index(es):
    • Date
    • Thread