CoreData: FATAL ERROR: The persistent cache of section information does not match the current configuration. You have illegally mutated the NSFetchedResultsController's fetch request, its predicate, or its sort descriptor without either disabling caching or using +deleteCacheWithName:と表示されて、アプリがクラッシュした場合の対処法。
何らかの理由でCore Dataのキャッシュの整合性がとれていないというメッセージなので、キャッシュを使用しないか、初期処理としてキャッシュをクリアする。
キャッシュをクリアする
[NSFetchedResultsController deleteCacheWithName:@"Root"];
キャッシュを使用しない(キャッシュ名にnilを設定する)
NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:managedObjectContext sectionNameKeyPath:nil cacheName:nil];
参考記事:
http://cocoadays.blogspot.jp/2010/07/uisearchdisplaycontroller_15.html
http://cocoadays.blogspot.jp/2010/06/nsfetchedresultscontroller-performfetch.html
http://stackoverflow.com/questions/2709768/nsfetchedresultscontroller-crashing-on-performfetch-when-using-a-cache