NSFetchedResultsController in iOS 10 Swift 3

平成30年3月24日(土曜日)

[iOS 10] CoreDataの変更内容をまとめてみました。

以下は、未解決!!

error
Study CoreData 14 ~目に見えるしあわせ~


2018-03-24 13:54:18.888127+0900 csv2core[4392:207798] [error] error: (NSFetchedResultsController) A section returned nil value for section name key path 'category'. Objects will be placed in unnamed section
CoreData: error: (NSFetchedResultsController) A section returned nil value for section name key path 'category'. Objects will be placed in unnamed section

let request = NSFetchRequest(entityName:"NasaPicture")  
request.predicate = Predicate(format: "isPagedResult == YES")  

request.sortDescriptors = [SortDescriptor(key: "date", ascending: false)]  

fetchedResultsController = NSFetchedResultsController(fetchRequest: request, managedObjectContext: moc, sectionNameKeyPath: nil, cacheName: nil)  

How to initialize a NSFetchedResultsController in iOS 10 Swift 3