このCoreDataエラーが発生します。このエラーが発生する理由はわかりません。Transformable型は使用していません。変換可能なプロパティを使用していることを示すコードが何も表示されません。プロジェクトの作成時に[コアデータを使用]オプションを選択して、XcodeにCoreDataをセットアップさせました。他の同様の質問は役に立ちません。答えは、プロジェクトの作成時にXcodeが作成されたことがわかるようなコードに関係しているためです。このエラーがデバッグウィンドウに表示されても、プロジェクトはクラッシュしません。Xcode 11.3とiOS用のGoogle Maps SDK for iOS 12を使用していますが、iOS 13.3を搭載したiPhone 8デバイスで実行されています。
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.
これはエラーをトリガーするコードです:
do {
storeAddresses = try managedObjectContext.fetch(Address.fetchRequest())
} catch {
print(error)
}
次のコアデータオブジェクトを使用しています。
住所エンティティ
位置属性
タイプ整数16
テキスト属性タイプ文字列
タイムスタンプ属性タイプ日付
ルート関係宛先ルート逆アドレス
ルートエンティティ
タイムスタンプ属性タイプ日付
タイトル属性タイプ文字列
アドレス関係宛先アドレス逆ルート
管理対象オブジェクトクラスの次のコードがあります。
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)
}