• 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: Prevent space characters in a NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Prevent space characters in a NSTextField


  • Subject: Re: Prevent space characters in a NSTextField
  • From: Yann Bizeul <email@hidden>
  • Date: Mon, 22 Nov 2004 22:00:24 +0100

but I would like to totally ignore all the characters different than numbers
and "." and ",". This way, if the user hit a space or a "x", the field
doesn't get modified at all.
Looks like you want to write your own formatter :-)
Apple provide some two formatters for your convenience, but you can create your own, and use methods like
- (BOOL)isPartialStringValid:(NSString **)partialStringPtr proposedSelectedRange:(NSRangePointer)proposedSelRangePtr originalString:(NSString *)origString originalSelectedRange:(NSRange)origSelRange errorDescription:(NSString **)error
are interesting for what you want to do.


See NSFormatter doc for more informations.
file:///Developer/ADC Reference Library/documentation/Cocoa/ Reference/Foundation/ObjC_classic/Classes/NSFormatter.html


--
Yann Bizeul - yann at tynsoe.org
Cocoa Developer, visit my projects at :
http://projects.tynsoe.org/

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Prevent space characters in a NSTextField (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: Installing a font programmatically?
  • Next by Date: Re: Installing a font programmatically?
  • Previous by thread: Prevent space characters in a NSTextField
  • Next by thread: Re: Prevent space characters in a NSTextField
  • Index(es):
    • Date
    • Thread