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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:00:37+00:00 2026-06-10T17:00:37+00:00

What I want is to be able to search a UITableView , and have

  • 0

What I want is to be able to search a UITableView, and have other arrays be narrowed down to the results of the cell’s textlabel array. That probably just made no sense to no one. Here’s an example.

An array called titleArray that fills the cell’s textLabel:

"Toyota Yaris"
"Ford Escape"
"Ford F-150"

Another array called detailArray that fills the detail text label below the textLabel in a cell:

"Car"
"SUV"
"Truck"

When I search for “Ford” I want the UITableView to display the cells like this:

Cell 1: Ford Escape
        SUV

Cell 2: Ford F-150
        Truck

But it is displaying like this:

Cell 1: Ford Escape
        Car

Cell 2: Ford F-150
        SUV

Essentially it narrowed down the titleArray but not the detailArray so it is display objects 1 & 2 from titleArray but 0 & 1 from detailArray. If this confuses you please ask any questions!

  • 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-10T17:00:39+00:00Added an answer on June 10, 2026 at 5:00 pm

    In your code, you are likely creating UITableViewCell object in a message named tableView:cellForRowAtIndexPath:. I would review this code for your issue. When you create/retrieve the UITableViewCell, you will then fill in the title and detail (check this in the debugger). I note that the example you are following is creating a pared down array of items in response to your search argument. It seems most likely that you will need to pare down the detail array at the same time you pare down the title array. You may also need to search in your detail array (depending on how you want your app to function). This could complicate your search logic some.

    //Possible search logic
    for (int iii = 0; iii < titleArray.count; iii++) {
        if (<titleArray matches search string>) {
            [titlesToDisplay addObject:[titleArray objectAtIndex:iii]];
            [detailsToDisplay addObject:[detailArray objectAtIndex:iii]];
            //Assuming that you have titles and details in corresponding slots.
        }
    }
    

    Now when you set the title and detail settings for your UITableViewCell, you should count entries in titlesToDisplay and retrieve entries from titlesToDisplay and detailsToDisplay.

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

Sidebar

Related Questions

I the following multidimensional array that I want to be able to search a
I have a multidimensional array in PHP and want to be able to search
I want to be able to take an image that i have already captured
I have successfully indexed files, and want to be able to search using wildcards.
I want to be able to search and return results across the majority of
i want the users on my site to be able to search for other
I have a list like so and I want to be able to search
I have a string that contains many asterisk' '*'. I want to be able
I have a table with users. I want to be able to search for
Similar Stack Overflow Question I want users to be able to search through my

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.