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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:10:19+00:00 2026-06-05T10:10:19+00:00

In past, I followed a little tutorial to achieve a UISearchBar in my UITableView.

  • 0

In past, I followed a little tutorial to achieve a UISearchBar in my UITableView.

It was made of arrays. Now that I have .plist file which handles everything, how would the searchBar be?
I mean, I did something like:

 copyLists = [[NSMutableArray alloc] initWithArray:sortedList copyItems:YES];

Where sortedList is the array which contains the plist.

Basically the searchBar works fine, but when I type in a word, it doesn’t show any cells, even if I write the exact name of a cell.

Should it return the key name contained in the plist which is the name of the cell?

How would the searchBar change with plists?

  • 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-05T10:10:21+00:00Added an answer on June 5, 2026 at 10:10 am
    - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString
    {
        [self.filteredList removeAllObjects]; // First clear the filtered array.
    
        NSArray *objcts = unfilteredList;
    
        for (NSDictionary *section in objcts)
        {
            for (NSDictionary *row in [section valueForKey:@"Rows"])
            {
                NSRange rng = [[row valueForKey:@"name"] rangeOfString:searchString options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch)];
    
                if (rng.length != 0)
                    [self.filteredList addObject:row];
            }
        }
        // Return YES to cause the search result table view to be reloaded.
        return YES;
    }
    

    make sure your Search Bar and Search Display Controller delegate are set right. Then for displaying the cell use:

    NSArray *rows;
    if (tableView == self.searchDisplayController.searchResultsTableView)
    {
        rows = filteredList;
    } else {
        NSDictionary *section = [unfilteredList objectAtIndex:indexPath.section];
        rows = [section objectForKey:@"Rows"];
    }
    cell.textLabel.text = [[rows objectAtIndex:indexPath.row] objectForKey:@"name"];
    

    and change the logic for rowCount, titleHeader, etc.

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

Sidebar

Related Questions

I have a project that has a submodule at lib/three20 My .gitmodule file looks
I have been trying for the past two days now to implement Admob ads
In the past it was my understanding that the Lat/Lon of an airport had
In the past I have used MAPISendMail to launch Outlook (or whatever the desired
I have been trying to get a2billing to work for the past 4 days
I'm trying to write an sql function in Postgresql that will parse a file
I am new to android development but in the past few weeks I have
So Oracle has NULLS FIRST, which I can use to have null values sorted
In past couple of days, I have read about quite a lot about dependency
This may have been asked in the past but I couldnt find a suitable

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.