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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:27:39+00:00 2026-06-14T00:27:39+00:00

I have two arrays (first names, Last names) in my TableView ( cell.textLabel and

  • 0

I have two arrays (first names, Last names) in my TableView (cell.textLabel and cell.detailTextLabel)
I want to make a search bar in this TableView.
I have created class with two string.

@interface clientContent : NSObject { }
@property (nonatomic, strong) NSString *clName;
@property (nonatomic, strong) NSString *clLast;
@end

then I have created array in main class (which have Table view) and added my information
like this

    for (int i = 0; i < PQntuples(clientQuery); i++)
{
    clientContent *cc = [[clientContent alloc] init];
    cc.clName = [[NSString alloc] initWithUTF8String:PQgetvalue(clientQuery, i, 0)];
    cc.clLast = [[NSString alloc] initWithUTF8String:PQgetvalue(clientQuery, i, 1)];
    [allClients addObject:cc];
}

after this I load it into tableView;

clientContent *cc = [allClients objectAtIndex:indexPath.row];
    cell.textLabel.text = cc.clName;
    cell.detailTextLabel.text = cc.clLast;
}

Then I use

-(BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString

How to make it right? I can’t understand..

  • 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-14T00:27:41+00:00Added an answer on June 14, 2026 at 12:27 am

    You should override searchDisplayController:shouldReloadTableForSearchString: delegate method of UISearchDisplayController and filter datasource array for searchResultsTableView as you want.

    You can apply predicate on your array(array of clientContent object) and change dataSource array. Using predicate you can filter your array on both fields(clName & clLast).

    You can get help related to predicates from https://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSPredicate_Class/Reference/NSPredicate.html

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

Sidebar

Related Questions

I have two arrays the first one has this structure Parameter Keys array array
i have two arrays like this first array Array ( [0228] => Array (
I have two arrays, the first one contents numbers and the second one use
Suppose I have two arrays like the following: $arr2 = array(array(first, second), array(third, fourth));
I have two arrays, @names and @employees , that are filled with strings that
I have two arrays that look like this: (this one is ordered by value_max
I have two arrays built while parsing a text file. The first contains the
I have image Array with two images out of that first image its showing
I have two arrays. I'd like to copy ranges of data from one of
I have two arrays and I post the arrays in one input; <input name='sistem[]'

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.