key-value validation
key-value validation
- Subject: key-value validation
- From: Matthew Johnson <email@hidden>
- Date: Tue, 18 Nov 2003 20:59:12 -0600
I noticed the key-value validation docs specify "an implementation of
-set<Key>: for a property should never call the validation methods."
Is this with the intention that -validate<Key>:error: is always called
prior to the call to -set<Key>? I assume this is because the
controller layer needs to separate validation from actual setting of a
value. If so, is it sensible for a model to implement a convenience
method -set<Key>IfValidated:error: to take care of validation and
setting the value if validation is successful? This seems like the
right approach so that code that is directly using the model rather
than going through kvc would have a nice clean interface...
Matthew
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.