Estou recebendo esse erro CoreData. Não tenho idéia do motivo pelo qual estou recebendo esse erro. Não estou usando nenhum tipo de transformável. Não vejo nada no meu código indicando que estou usando propriedades transformáveis. Deixei o Xcode configurar o CoreData selecionando a opção Usar Dados Principais ao criar meu projeto. As outras perguntas semelhantes não ajudam, porque as respostas têm a ver com código que se parece com qualquer coisa que eu possa achar que o Xcode criou quando o projeto foi criado. O projeto não falha quando esse erro aparece na janela de depuração. Estou usando o Xcode 11.3 e o Google Maps SDK para iOS para iOS 12, e ele está sendo executado em um dispositivo iPhone 8 com iOS 13.3.
CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/A2B8A56C-E0D5-467A-9300-8EDFB20574BE/Routes.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'
2020-01-13 12:42:00.771883-0600 Routes[4631:1067373] [error] fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.
CoreData: fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.
2020-01-13 12:42:00.771972-0600 Routes[4631:1067373] [error] CoreData: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.
CoreData: warning: Property 'value' on Entity 'GMSCacheProperty' is using nil or an insecure NSValueTransformer. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead.
CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/A2B8A56C-E0D5-467A-9300-8EDFB20574BE/Routes.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'
CoreData: warning: Property 'value' on Entity 'GMSCacheProperty' is using nil or an insecure NSValueTransformer. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead.
CoreData: annotation: Failed to load optimized model at path '/var/containers/Bundle/Application/A2B8A56C-E0D5-467A-9300-8EDFB20574BE/Routes.app/GoogleMaps.bundle/GMSCacheStorage.momd/StorageWithTileProto.omo'
CoreData: warning: Property 'value' on Entity 'GMSCacheProperty' is using nil or an insecure NSValueTransformer. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead.
Este é o código que aciona o erro:
do {
storeAddresses = try managedObjectContext.fetch(Address.fetchRequest())
} catch {
print(error)
}
Estou usando os seguintes objetos de dados principais:
Entidade de endereço
atributo de posição
tipo Inteiro 16
tipo de atributo de texto String
tipo de atributo de data e hora Data
destino de relacionamento de rota Endereços inversos da rota
Entidade de rota
tipo de atributo de data e hora Data
tipo de atributo title String
endereços destino de relacionamento Rota inversa de endereço
Eu tenho o seguinte código para classes de objeto gerenciado:
public class Address: NSManagedObject {
}
extension Address {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Address> {
return NSFetchRequest<Address>(entityName: "Address")
}
@NSManaged public var text: String?
@NSManaged public var timestamp: NSDate
@NSManaged public var position: Int16
@NSManaged public var route: Route?
}
public class Route: NSManagedObject {
}
extension Route {
@nonobjc public class func fetchRequest() -> NSFetchRequest<Route> {
return NSFetchRequest<Route>(entityName: "Route")
}
@NSManaged public var timestamp: NSDate
@NSManaged public var title: String?
@NSManaged public var addresses: NSSet?
}
// MARK: Generated accessors for addresses
extension Route {
@objc(addAddressesObject:)
@NSManaged public func addToAddresses(_ value: Address)
@objc(removeAddressesObject:)
@NSManaged public func removeFromAddresses(_ value: Address)
@objc(addAddresses:)
@NSManaged public func addToAddresses(_ values: NSSet)
@objc(removeAddresses:)
@NSManaged public func removeFromAddresses(_ values: NSSet)
}