Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6677293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:06:03+00:00 2026-05-26T04:06:03+00:00

On my app I need to do this: when a character is typed on

  • 0

On my app I need to do this: when a character is typed on TextView to be saved on a NSString and after that to be replace with ‘*’. I tried this :

- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text
{
    NSLog(@"typing...");
    text=@"*";
    passwordText=textView.text;
    NSLog(@"password %@",passwordText);

    NSString* nextText = [textView.text stringByReplacingCharactersInRange:range withString:text];
    textView.text=nextText;
    NSLog(@"next %@",nextText);
    NSLog(@"textview.text %@",textView.text);

    return YES;
}

where passwordText is the NSString in which I want to save the text introduce from keyboard on UITextView.

The result is this : http://i54.tinypic.com/2cx9ueo.png (here I introduced ‘we’ and I see this :’*w*e’. Can anyone help me to solve this?

I mention that I must do this using UITextView, and not UITextField.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:06:04+00:00Added an answer on May 26, 2026 at 4:06 am

    I can tell you why you get character along with the *, though i am not sure whether your approach is worth to go through this.

    make your return statement as NO, this will discard the new key pressed. The YES is currently placing that character next to your programmatic ‘*’.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Django app that use a django-tagging. I need to port this
I have this need to place my app in the share/send context menu so
So I need to access this service from my rails app. I'm using soap4r
Basically what I need is to do something like this App.CommentView = Backbone.View.extend({ className:
I have a file as documentRoot/app/webroot/myFile.php I need to be able to access this
I need to understand this piece better because when I reached that step in
(This algorithm is for an iPhone app I am working on, if that helps
I need to replace a particular character in a text file with another character.
I need a 6 character alphanumeric ID for use in my rails app, which
I have this problem with an app of a printer. I need to know

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.