• 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
Preventing empty NSTextFields that use NSNumberFormatter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Preventing empty NSTextFields that use NSNumberFormatter


  • Subject: Preventing empty NSTextFields that use NSNumberFormatter
  • From: Sean McBride <email@hidden>
  • Date: Mon, 04 Aug 2014 14:01:45 -0400
  • Organization: Rogue Research Inc.

Hi all,

NSNumberFormatter, applied to an NSTextField, will very nicely reject things like letters, and optionally a bunch of things like negative numbers, non-integers, etc.

But I've just noticed that it doesn't seem to help if the textfield is left entirely empty.  Is that not something NSNumberFormatter can help with?  I just find that surprising with all the other options it has...

If it can't, I guess the best choices are using NSControlTextEditingDelegate or key value validation...?

Thanks,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

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


  • Follow-Ups:
    • Re: Preventing empty NSTextFields that use NSNumberFormatter
      • From: Keary Suska <email@hidden>
  • Prev by Date: Re: Talking to other apps
  • Next by Date: Re: Talking to other apps
  • Previous by thread: Re: Talking to other apps
  • Next by thread: Re: Preventing empty NSTextFields that use NSNumberFormatter
  • Index(es):
    • Date
    • Thread