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 1022825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:31:22+00:00 2026-05-16T11:31:22+00:00

Is there a way to implement custom Auto-completion for a UITextView, say by giving

  • 0

Is there a way to implement custom Auto-completion for a UITextView, say by giving it a NSDictionary or NSArray of Strings to watch out for?

  • 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-16T11:31:23+00:00Added an answer on May 16, 2026 at 11:31 am

    You would have to program it yourself. If you implement the UITextViewDelegate Protocol, the function

    - (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *) 
    

    is called every time the user enters / deletes a character in the text view. So for example if the user enters a char ‘s’, then in this function you would check the array w the words you want to autocomplete to see if it should autocomplete.

    CONDITIONS –

    • If there is only one value that starts with ‘s’, autocomplete.

    • If there are no values that start with ‘s’, or if there are multiple values that start with ‘s’, (ELSE) do not autocomplete.

    I recommend that your autocomplete string array is sorted alphabetically, and that you keep a global variable that points to where you left off in the array. For example if the user enters ‘s’, and the first word with ‘s’ is in array index 5, then when the user enters another char, ‘u’ making the search string “su”, you should be able to remember to start in array index 5 to find the autocomplete string faster (and not iterate through useless data). I would use a C array for this, although an NSArray would work.

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

Sidebar

Related Questions

Is there any way to implement a custom data source that works with the
Is there either a way to implement UISwitch with custom graphics for the switch-states?
I'm attempting to implement custom termination behavior in a Cocoa application. Normally when my
I am trying to implement a custom memory manager and I am wondering if
In our Smartclient app we currently use PostSharp to inject get/set code into auto
Trying to implement a UITableView of names similar to the built-in Contacts iPhone app
Yes, setting value to a JList, know that. But i want to know is
I'm trying to create a setup project and I can't believe how painful it
So, by a hi lar ious series of events , I downloaded the FParsec
I have a class that is maps to a field in a database. The

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.