• 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: Number only NSTextField's
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number only NSTextField's


  • Subject: Re: Number only NSTextField's
  • From: Apparao <email@hidden>
  • Date: Fri, 21 Dec 2007 10:20:08 +0530

Write your own custom formatter, which is subclass of NSFormatter. Read the following article exists in your machine:

file:///Developer/ADC Reference Library/documentation/Cocoa/ Conceptual/DataFormatting/index.html


- Apparao. Effigent Inc.


On Dec 21, 2007, at 10:03 AM, Eric Gorr wrote:

I found this old thread:

http://lists.apple.com/archives/cocoa-dev/2002/Sep/msg00112.html

which suggests applying a NSNumberFormatter to my field.

I have been able to do this and, while it does seem to only accept actually numbers in the field (the focus won't change to another control until it is a number), I can still type letters, etc. into the field as well.

I would prefer that it just beep when I enter a letter, etc. and for that letter to never appear in the field.

What is the best way to accomplish this?

Thank you.

_______________________________________________

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:
40effigent.net


This email sent to email@hidden


_______________________________________________

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: Number only NSTextField's
      • From: Eric Gorr <email@hidden>
References: 
 >Number only NSTextField's (From: Eric Gorr <email@hidden>)

  • Prev by Date: Re: Opacity of Menus
  • Next by Date: Re: Number only NSTextField's
  • Previous by thread: Number only NSTextField's
  • Next by thread: Re: Number only NSTextField's
  • Index(es):
    • Date
    • Thread