5

I am using a NSFetchedResultsController in my app with a custom sectionNameKeyPath (named "formattedDate") to group together multiple elements in the table view.

The formattedDate property is a property defined in an extension of my NSManagedObject (I am using Xcode automatic codeine for Class definition, this is the reason why I added this property in the extension). This property is not in the Core Data model (not a transient property).

extension ActivityMO {
    var formattedDate: String {
        let dateFormatter = DateFormatter()
        dateFormatter.dateFormat = "MMMM yyyy"
        return dateFormatter.string(from: endDate as Date!)
    }
}

My app is running fine on iOS10.

On iOS11, I get the following error and the app crashed:

2017-08-10 11:52:12.735277+0200 *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[< ActivityMO 0x60000048f820> valueForUndefinedKey:]: the entity ActivityMO is not key value coding-compliant for the key "formattedDate".'

What am I doing wrong? Has something changed with iOS11?

Thanks,

Axel

alpennec
  • 1,864
  • 3
  • 18
  • 25

0 Answers0