Re: NSTextField: edits are committed even when -control:isValidObject: returns NO
Re: NSTextField: edits are committed even when -control:isValidObject: returns NO
- Subject: Re: NSTextField: edits are committed even when -control:isValidObject: returns NO
- From: Quincey Morris <email@hidden>
- Date: Thu, 11 Jul 2013 13:36:01 -0700
On Jul 11, 2013, at 13:01 , Matthew LeRoy <email@hidden> wrote:
> I don't feel that I am relying on the delegate methods to capture any state change[…]
I wasn't suggesting that you are doing anything wrong, rather that there's a more positive point of control.
> I assumed that the field editor would not commit the edit (that is, call setObjectValue:) until after calling control:isValidObject:, and even then only if that method returns YES.
I don't know, but this seems like an unlikely assumption. The "objectValue" property *is* the value that the text field contains, and I doubt that there's any API contract that it's a validated value.
Note that you've used "commit" in an unusual sense, in Cocoa terms. In the Apple documentation, "commit" means to transfer the raw value from a text field to the data model. The communication between the field editor and the text field is something of an implementation detail, and probably doesn't follow as clear a protocol as you would wish.
_______________________________________________
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