• 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
How apply a mask (xxx-xxx-xxxx for phone #) to a text field while inputting?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How apply a mask (xxx-xxx-xxxx for phone #) to a text field while inputting?


  • Subject: How apply a mask (xxx-xxx-xxxx for phone #) to a text field while inputting?
  • From: Steve Fogel <email@hidden>
  • Date: Tue, 23 Jun 2009 00:12:18 -0700

Hi, all...

In my iPhone app I'd like to have a text field that duplicates the behavior of the phone field in the Contacts application, applying a mask to the field as it's being entered.

So if the user types 2125551212, I'd like the text field to display (212) 555-1212.

I know about the method textField:shouldChangeCharactersInRange:replacementString:, which would enable me to brute force this with lots of code. However, I'd like to be able to take locale into consideration, so this becomes non- trivial.

Anyone know of any locale-aware foundation classes that help with this?

Thx

Steve
_______________________________________________

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: How apply a mask (xxx-xxx-xxxx for phone #) to a text field while inputting?
      • From: WT <email@hidden>
  • Prev by Date: Re: Beginner Question Re: Memory Management
  • Next by Date: display Mac id
  • Previous by thread: Re: UML Diagramming or Other Helpful Software?
  • Next by thread: Re: How apply a mask (xxx-xxx-xxxx for phone #) to a text field while inputting?
  • Index(es):
    • Date
    • Thread