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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:50:08+00:00 2026-05-28T04:50:08+00:00

I am implementing mobile local search in iPhone application: – (void)searchBar:(UISearchBar *)theSearchBar textDidChange:(NSString *)searchText

  • 0

I am implementing mobile local search in iPhone application:

    - (void)searchBar:(UISearchBar *)theSearchBar textDidChange:(NSString *)searchText {

        //Remove all objects first.
        [copyListOfItems removeAllObjects];

        if([searchText length] > 0) {

            [ovController.view removeFromSuperview];
            searching = YES;
            letUserSelectRow = YES;
            self.tableView.scrollEnabled = YES;
            [self searchTableView];
        }
        else {

            [self.tableView insertSubview:ovController.view aboveSubview:self.parentViewController.view];

            searching = NO;
            letUserSelectRow = NO;
            self.tableView.scrollEnabled = NO;
        }

        [self.tableView reloadData];
    }



    - (void) searchTableView {

        NSString *searchText = searchBar.text;
        NSMutableArray *searchArray = [[NSMutableArray alloc] init];

        for (NSDictionary *dictionary in listOfItems)
        {
            NSArray *array = [dictionary objectForKey:@"key_pdescription"];
            [searchArray addObjectsFromArray:array];
        }

//in requirement searchArray has more than 50k objects
        for (NSString *sTemp in searchArray)
        {
            NSRange titleResultsRange = [sTemp rangeOfString:searchText options:NSCaseInsensitiveSearch];

            if (titleResultsRange.length > 0)
                [copyListOfItems addObject:sTemp];
        }

        [searchArray release];
        searchArray = nil;
    }

It’s working fine for hundreds of records,but I have to implement for 50 thousands or more than that,that search is very very slow after typing 1 character I have to wait to enter next character.
I want to if someone has implemented some optimized algorithm for mobile local search,please guide me how to proceed.

  • 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-28T04:50:09+00:00Added an answer on May 28, 2026 at 4:50 am

    you can use core data and limit the fetch result and populate the data on search result screen,and you can implementat pagination for the next set of records.

    NSFetchRequest *request = [[NSFetchRequest alloc] init];
    //[request setEntity:entity];
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"predicateformart"];
    [request setPredicate:predicate];
    [request setFetchLimit:100];//100 records for example
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm implementing a distributed application, server with rails and mobile clients in objective c
I am implementing one application some fields are edittext in edittext clicking open mobile
i have done implementing mobile app on android,webos,blackberry,iphone. now i integrate project with .net
When implementing a needle search of a haystack in an object-oriented way, you essentially
I want to implement a web application with separate user interface for mobile and
We're working on a web app that will deployed to mobile devices, iPad, iPhone,
I'm implementing a mobile api. One of the requests processes json data and returns
I am implementing a mobile presentation of a website using jQuery Mobile. The JQM
Whilst implementing my first MVVM application in WPF, I've been wondering about the pros
I'm implementing a jquery mobile site and I've hit a snag when trying to

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.