• 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: formatter use for whitespace
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: formatter use for whitespace


  • Subject: Re: formatter use for whitespace
  • From: j o a r <email@hidden>
  • Date: Fri, 25 Apr 2003 20:44:30 +0200

One way to do this is to have the delegate listen for the textDidChange: notifications and every time the user changes a character check to see if the current string is valid, and if not beep and restore the trimmed string. It's easier than creating a full formatter, and works in most cases.

j o a r

On Friday, Apr 25, 2003, at 20:07 Europe/Stockholm, Theodore Petrosky wrote:

I have been working on an interface to a postgresql
database. part of it a client list (names, addresses,
etc). I want to limit an NSTextField so the user can
not enter a whitespace as a leading character.
However, whitespaces are permitted in the middle of an
entry.

Is this doable in a formatter or is it better to post
process the entry and remove any leading and double
spaces?

Spaces are legal characters, just not at the beginning
or end.

Currently, I am trimming the whitespace and manually
parsing the string for double spaces after the user
clicks to accept the entry.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >formatter use for whitespace (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: Quicktime Atoms
  • Next by Date: Re: natural languages
  • Previous by thread: formatter use for whitespace
  • Next by thread: Re: formatter use for whitespace
  • Index(es):
    • Date
    • Thread