How apply a mask (xxx-xxx-xxxx for phone #) to a text field while inputting?
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