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: Quincey Morris <email@hidden>
- Date: Tue, 01 May 2012 14:47:40 -0700
On May 1, 2012, at 14:23 , Ben Kennedy wrote:
> I have an NSTableView whose data source is bound to an NSArrayController. To one of its columns (displaying a custom type) I have attached a custom NSFormatter subclass. The NSFormatter correctly returns NO from getObjectValue:forString:error: if the supplied string is not acceptable. Despite this, however, validation is not enforced; when tabbing out of the field, the table view carries on and just assigns a null value to the corresponding property.
Double-check that "Validates immediately" is checked for the binding. Counter-intuitively, this doesn't mean "immediately" in the sense of every keystroke, but "immediately" in the sense of when editing ends. If it's not checked, validation is presumably deferred until an entire view's worth of fields has been entered.
_______________________________________________
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