• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Substituting characters in a UITextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Substituting characters in a UITextField (From: Steve Fogel <email@hidden>)
 >Re: Substituting characters in a UITextField (From: DKJ <email@hidden>)

  • Prev by Date: How do I draw a CGImage (30 sq px PNG) upon a host (larger) CGImage <PNG> Image at a specific coordinate?
  • Next by Date: Re: GC pros and cons
  • Previous by thread: Re: Substituting characters in a UITextField
  • Next by thread: Open Position at IRCAM: MacOSX GUI Developper (C++/Objective-C)
  • Index(es):
    • Date
    • Thread