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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:20:11+00:00 2026-05-18T02:20:11+00:00

My iphone App shows a table view having list of 6000 items. (these items

  • 0

My iphone App shows a table view having list of 6000 items. (these items are in SQLite file)

User can search these items. BUT, when I click Search bar & start typing the first letter, it takes ages before I can type in the second letter. Similarly it takes long time to type each letter before I could begin searching.

Is there a way to increase the typing speed of the search toolbar so that user can quickly type in 5-6 letters for searching?

I appreciate your help.
Thanks!

  • 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-18T02:20:11+00:00Added an answer on May 18, 2026 at 2:20 am

    If your search is too slow and therefore blocks the UI, you should perform the search asynchronously so as not to block the main thread. To do this, there are many options, including Grand Central Dispatch (4.0+), NSOperation, performSelectorInBackground:.... The best approach for you depends on the architecture of your app/algorithm and what you’re most comfortable with.

    Edit: to start, read the documentation for performSelectorInBackground:withObject: and performSelectorOnMainThread:withObject:waitUntilDone:. From the search bar delegate method, try calling something like:

     // -searchForString: is our search method and searchTerm is the string we are searching for
     [self performSelectorInBackground:@selector(searchForString:) withObject:searchTerm];
    

    Now Cocoa will create a background thread and call your custom -searchForString: method on that thread. That way, the main thread will not be blocked. The custom method should look something like this:

    - (void)searchForString:(NSString *)searchTerm
    {
        // First create an autorelease pool (we must do this because we are on a new thread)
        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    
        // Perform the search as you normally would
        // The result should be an array containing your search results
        NSArray *searchResults = ...
    
        // Pass the search results over to the main thread
        [self performSelectorOnMainThread:@selector(searchDidFinishWithResult:) withObject:searchResults waitUntilDone:YES];
    
        // Drain the ARP
        [pool drain];
    }
    

    Now, the custom method searchDidFinishWithResult: is responsible for updating the UI with the search results:

    - (void)searchDidFinishWithResult:(NSArray *)searchResult
    {
        // Update the UI with the search results
        ...
    }
    

    This is probably the easiest approach for a start. The solution is not complete yet, partly because search tasks will pile up if the users types faster than a search can complete. You should perhaps incorporate an idle timer that waits a while until a search is fired off or you would need to cancel an ongoing search task (NSOperation might be better in that case).

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

Sidebar

Related Questions

I have an iPhone app that shows a simple view (View 1) that has
I've created a table view in an iPhone app using Interface Builder (IB). My
I can successfully push only next view in my iPhone app. However, cause the
I have an iphone app that uses table view as the interface. Each time
I have an iPhone app that utilizes TableView to list tagged items that the
In my iPhone app, In Table view I have Two labels in one cell..
I have an iPhone app which has a Table View-based data input screen with
my iphone app crashes unexpectedly and looking at the crash log I can't tell
My iphone app called Google Local Search(non javascript version) to behave some search business.
I am building a core data iphone app, and having trouble with retrieving one-many

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.