Вопрос

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!

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top