Re: No validation with a bound NSTableView and custom NSFormatter
Re: No validation with a bound NSTableView and custom NSFormatter
- Subject: Re: No validation with a bound NSTableView and custom NSFormatter
- From: Ben Kennedy <email@hidden>
- Date: Tue, 01 May 2012 19:20:10 -0700
On 01 May 2012, at 5:25 pm, Quincey Morris wrote:
> I'm not aware that KVC-style validation ever happens automatically *except* for bindings that have have "Validates immediately" checked.
Thanks for clarifying that -- I believe you're right.
> AFAIK, the validation performed by a number formatter is limited to its own internal understanding (modified by the properties you set) of what a valid number looks like. I don't see how it could know what validate<Key>: method to call.
What I meant was that since the formatter's statement of invalidity seemed to be ignored by the table view, I was then expecting the NSTableView machinery to at least call validate<Key>: on its data source -- and indeed it does, if both a binding is configured and "validates immediately" is checked.
(Of course in retrospect this only makes sense for bindings, since in a NSTableViewDataSource setup there is no knowledge of the data model except within the data source's tableView:objectValueForTableColumn:... and tableView:setObjectValue:... methods.)
The issue I'm still having is that non-bound columns (i.e., those controlled by the latter two NSTableViewDataSource methods) are not enforcing validity when the attached formatter returns NO from getObjectValue:forString:errorDescription:.
cheers,
b
--
Ben Kennedy, chief magician
Zygoat Creative Technical Services
http://www.zygoat.ca
_______________________________________________
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