Re: Substituting characters in a UITextField
Re: Substituting characters in a UITextField
- Subject: Re: Substituting characters in a UITextField
- From: DKJ <email@hidden>
- Date: Fri, 26 Jun 2009 13:00:00 -0700
This may be the solution: a UITextView instead of UITextField, with
this in the delegate:
- (BOOL)textView:(UITextView *)textView
shouldChangeTextInRange:(NSRange)range
replacementText:(NSString *)text
{
if( [text isEqualToString:@"C"] )
{
NSString *newString = [textView.text
stringByReplacingCharactersInRange:range withString:@"\u2192"];
textView.text = newString;
range = NSMakeRange(range.location+1, range.length);
textView.selectedRange = range;
return NO;
}
return YES;
}
_______________________________________________
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