UITextField formatting for IP Address
UITextField formatting for IP Address
- Subject: UITextField formatting for IP Address
- From: Alex Kac <email@hidden>
- Date: Fri, 16 Oct 2009 19:26:31 -0500
On desktop Cocoa I can put in a custom formatter on a textfield and
get what I'm looking for. On iPhone, I can say I'm a bit confused as
to the best way to handle this.
Given a UITextField and my desire to have the user type in an IP
address, it sounds like it could be simple, but I can't figure it out.
Using
- (BOOL)textField:(UITextField *)textField
shouldChangeCharactersInRange:(NSRange)range replacementString:
(NSString *)string
works fine if I'm assuming the user is simply typing in the text going
forward. The problem is if a user edits the text field then they lose
their place as I set the text.
So my guess to this is that no I cannot do this (though I'm sure I've
seen it on the iPhone), but would there be a good way to handle this
properly?
"There will always be death and taxes; however, death doesn't get
worse every year."
-- Anonymous
_______________________________________________
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