iphonecocoa-touchxcodecore-dataipod-touch

iOS Filter NSFetchedResultsController Efficiently


I'm attempting to add search support to a Core Data backed UITableView and started to hit some performance issues. I currently have associations to two NSFetchedResultsController (one for regular and one for searching). In my UISearchDisplayDelegate methods I release and recreate my NSFetchedResultsController after each call. However, this causes lag while typing! Is there a more efficient way to filter an NSFetchedResultsController? I've setup my batch size to around 50 items and my database has a few thousand records if that makes a difference. Thanks!


Solution

  • The NSFetchedResultsController documentation makes it pretty clear: