• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSNumberFormatter erases invalid values on Lion with 10.6 SDK
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSNumberFormatter erases invalid values on Lion with 10.6 SDK (From: George Nachman <email@hidden>)

  • Prev by Date: Re: automaticallyNotifiesObserversOf<property>
  • Next by Date: Re: Why does ARC retain method arguments even with full optimization?
  • Previous by thread: NSNumberFormatter erases invalid values on Lion with 10.6 SDK
  • Next by thread: Moderator - List web back on line
  • Index(es):
    • Date
    • Thread