Attach a formatter to a UITextField on iPhone

Posted by charlax on Stack Overflow See other posts from Stack Overflow or by charlax
Published on 2010-02-15T18:09:04Z Indexed on 2010/04/04 1:03 UTC
Read the original article Hit count: 551

Filed under:
|

I'm trying to format an UITextField as user types text, for instance to show separator for thousands.

I found this web page : http://www.iphonedevsdk.com/forum/iphone-sdk-development/16512-trying-add-commas.html

It seems that shouldChangeCharactersInRange: is not a good solution. I thought of a custom UIView where the view would be updated as the user types digits, yet it would require recreating the wheel...

© Stack Overflow or respective owner

Related posts about iphone

Related posts about string-formatting