I have the following function that would remove from the "Map" entity (that has 'name' as the only attribute) the specified 'mapname', in this case 'peachfarm'.
However, I get the error:
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ valueForUndefinedKey:]: this class is not key value coding-compliant for the key peachfarm.'
func deleteMap(_ sender: UIButton) {
var mapname = sender.accessibilityHint
managedObjectContext.delete(fetchedResultsControllerForMapEntity.value(forKey: mapname!) as! NSManagedObject)
}
This is weird because I definitely have a value for the above key.