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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:45:15+00:00 2026-05-27T11:45:15+00:00

As a follow-up question to a previous post: filtering content for UITableView When filtering

  • 0

As a follow-up question to a previous post: filtering content for UITableView

When filtering a data set for UITableViews, assuming I used NSPredicate per the recommendation in the previous post, does the general idea look like this:

NSArray *allData;
NSMutableArray *filteredData;
  • When the filter button is pressed, use NSPredicate to populate
  • filteredData Reload the table with [tableView reloadData];

In my tableView datasource and delegate methods, I’d basically check if the filter button was on, and if it was show the filteredData, if not, show allData.

The thing I am unsure about, in one of the WWDC 2010 videos about tableviews, they say that reloadData is an expensive operation, and you should be updating your view instead using insert/delete/replace methods for the tableView. And the animation also gives the user context of what is happening. So if that is the case, do you still use reloadData? I can’t seem to figure out how the tableViews would know what to show if the filter was turned on and reloadData was not called. I’m assuming that you would have to reloadData if a filter was on, and then also update the view with the insert/delete/replace methods for the animation if you wanted to give the user some context of what is happening. Is that right? 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-27T11:45:16+00:00Added an answer on May 27, 2026 at 11:45 am

    If I understand you correctly the dataset isn’t changing just the order in which it’s being displayed,(Filtered). If this is the case calling reload data is the correct thing to do. Using the insert/remove/delete animations is primarily for editing a tableview(when in editing mode). Or when receiving “more” data or data updates(like from iCloud). I’ve only found calling reload data on a tableview to be expensive if the dataSource is extremely large with uncached images or some other large slow reading data(as in restful XML calls to remote servers). If your dealing primarily with text and/or small cached images it shouldn’t be any problem at all. If the filtering is removing or adding items to your array, you need to track where in the tableview they are , by index path , remove them, and then add the new pieces. Keeping more than one array around for a single datasource is way more expensive given the platform. Memory management is priority when we’re dealing with iOS, IMHO.

    One other thing to note here is the actual insertion and/or deletion of rows or sections has to be inside of an animation block begining with [beginUpdates] and finishing with [endUpdates]. Unless your doing it from inside the editing delegate methods.

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

Sidebar

Related Questions

This is a follow up question to a previous post on saving recent searches
This is a follow-up question to my previous post: Python/Scipy Interpolation (map_coordinates) Let's say
This is a follow-up question of my previous post . I am trying to
As a follow up to this previous question , I have a Core Data-based
This is a follow up to my previous question about using XMLHttpRequest() to post
This is a follow up post of my previous question about BASIC auth over
This is a follow up question to a previous question I asked about calculating
to follow my previous question: XDoclet, a dead tool? what tool can I use
This is really a follow on question to a previous one , where I
This question is a follow up to my previous question about getting the HTML

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.