Question

in a news project for my company I need to provide a search function.

I'm using a UITableViewController and CoreData/NSFetchedResultsController to show the news and a UISearchDisplayController to provide the search.

Now my question: What is the better way: - to use the same fetchedResultsController for the "normal" Table AND the search results table - to use a second fetchedResultsController for the search results table

Thanx!

Was it helpful?

Solution

Yes - basically it's best to have another NSFetchResultsController for search table.

It is better for performance when you switch between tables and modes (search and normal browsing).

Also you will get benefits from this approach when you implement NSFetchedResultsController delegate - to refresh tables when data changes - having 2 NSFetchedResultsController allows you to reload only one table if not needed to reload both.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top