Re: [SOLVED] Do CoreData validation methods get called for transient attributes?

  • At 7:04 PM -0800 11/12/07, <cocoa-dev-request...> wrote:
    > On Nov 12, 2007, at 3:38 AM, mmalc crawford wrote:
    >
    >> You are strongly discouraged from modifying the value during
    >> validation.
    >> <http://developer.apple.com/documentation/Cocoa/Conceptual/
    >>  KeyValueCoding/Concepts/Validation.html#//apple_ref/doc/uid/
    >> 20002173-169942-CJBHDJGC>
    >>
    >> mmalc
    >>
    >
    > I'm a bit confused about this. In the reference above under
    > "Implementing a Validation Method", outcome #2 is "A new object value
    > that is valid is created and returned." Does the strong
    > discouragement of this practice apply only to Core Data? In any case,
    > is there a more appropriate place to coerce a value?

    Well, perhaps it's more a vanilla discouragement.  It's easy to
    create infinite loops where your validation logic changes a managed
    object, we process the changes, the coalesced (and potentially
    propagated, KVO responded to, etc) changes are re-validated, your
    validation logic changes a managed object ...

    --

    -Ben
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today