Re: NSNumberFormatter erases invalid values on Lion with 10.6 SDK
Re: NSNumberFormatter erases invalid values on Lion with 10.6 SDK
- Subject: Re: NSNumberFormatter erases invalid values on Lion with 10.6 SDK
- From: Fritz Anderson <email@hidden>
- Date: Sat, 05 Nov 2011 09:31:44 -0500
On 2 Nov 2011, at 11:40 PM, George Nachman wrote:
> I just moved to XCode 4, from the Mac OS 10.5 SDK to the 10.6 SDK, and
> from Snow Leopard to Lion. A behavior that changed is that entering
> invalid text into an NSTextField with an NSNumberFormatter causes the
> entire field's contents to be erased rather than disallowing the bogus
> character from being added.
Try this: Subclass NSNumberFormatter, and implement isPartialStringValid:proposedSelectedRange:originalString:originalSelectedRange:errorDescription: (preferred) or isPartialStringValid:newEditingString:errorDescription:. You may have to setPartialStringValidationEnabled: YES.
At least, that's my reading of the documentation. I haven't tried it myself.
— F
_______________________________________________
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