Hi all,

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.

Even when I implement control:didFailToFormatString:errorDescription: in the 
NSTableView's delegate, an invalid null value is nevertheless accepted and 
focus moves to the next responder, despite returning NO.

My current implementation has been using an in-memory (transient) CoreData 
stack, but I have pared that back to simply use NSArrayController in "class" 
mode and behaviour is the same.

The modelled property in question is a custom class (not a plist-compliant 
primitive, hence in part the need for a custom NSFormatter); however, two-way 
behaviour in the NSTableView works fine except for the lack of validation.

I must be missing something fundamentally obvious, but I can't figure out where 
to approach the fix.  Enlightenment would be appreciated.

thanks,

-ben

--
Ben Kennedy, chief magician
Zygoat Creative Technical Services
http://www.zygoat.ca


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to