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