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

  • Home
  • SEARCH
  • 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 8246267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:27:03+00:00 2026-06-07T22:27:03+00:00

In iOS, when you start to type someone’s name in to send a new

  • 0

In iOS, when you start to type someone’s name in to send a new SMS/iMessage etc, an auto complete list pops up.

I am trying to recreate the way this search algorithm works, however it’s not as straight forward as you might think. You can try this out on your device to see what I mean, but for example if I type “Joh” or “Brow” then “John Brown” will show up. However typing “ohn” will not show any results. To make it even more difficult, typing in “Mr Green” will allow “Mr Evan Green” to show… try it yourself in messages, it’s probably easier to understand that way.

Is there an easy way to implement this autocomplete algorithm? (I have an array of NSStrings containing names, and a substring to filter them with).

If there’s no easy way, how would you go about this?

  • 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-06-07T22:27:05+00:00Added an answer on June 7, 2026 at 10:27 pm

    You should create a Trie out of your strings for this purpose. You can also use suffix tree (a improvement over the TRIE) or suffix array (stripped down data structure based on the suffix tree). Check out this link for algorithm using Trie.

    Check out this question for difference between these data structures.

    Idea of suffix tree is to have path to every suffix of the input string and than you can use tree search to find if a random string is matching the input string very fast.

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

Sidebar

Related Questions

I'll start by saying that I'm pretty new to iOS apps. I remember I
I start studing iOS last week and before I go any further I would
I'm about to start work on my first big iOS app, but haven't really
I'm about to start writing a static library for an iOS application and got
I trying to fix a strange bugg. People with IOS 4 can't even start
I'm trying to start from scratch with all my keys for iOS development by
I am a beginner in iOS development and have just start using the lasted
I've made a new project as a Single View iOS Application in Xcode. I've
My apps start crashing after upgrading to iOS 5 with Xcode 4.2. Otherwise the
When I start to debugging in XCode an IOS app at first time ask

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.