views:

312

answers:

1

How can I format a users text field input as they type and insert a "-" or " " on every 5th character.

4500000000000000 becomes 4500 0000 0000 0000

+1  A: 

Make a delegate for your text field, then implement -textField:shouldChangeCharactersInRange:replacementString: to update the text field whenever the user types / pastes anything.

KennyTM