gpt4 book ai didi

ios - 核心数据错误切换到使用 "NSSecureUnarchiveFromData"或 NSSecureUnarchiveFromDataTransformer 的子类

转载 作者:行者123 更新时间:2023-12-01 15:16:19 25 4
gpt4 key购买 nike

我收到此 CoreData 错误。我不知道为什么会收到此错误。我没有使用任何可转换类型。我在我的代码中看不到任何东西表明我正在使用可转换的属性。在创建项目时,我通过选择 Use Core Data 选项让 Xcode 设置 CoreData。其他类似的问题没有帮助,因为答案与我能找到的任何在创建项目时创建的 Xcode 的代码有关。当此错误出现在调试窗口中时,项目不会崩溃。我正在使用 Xcode 11.3 和适用于 iOS 12 的 Google Maps SDK,它在装有 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

文本属性类型字符串

时间戳属性类型日期

路由关系destination 路由反向地址

路由实体

时间戳属性类型日期

标题属性类型字符串

地址 关系 目的地 地址 反向 路由

我有以下托管对象类的代码:
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)

}

最佳答案

我认为您可能忽略了一个名为“GMSCacheProperty”的实体。

如错误消息中所述:

CoreData:警告:实体“GMSCacheProperty”上的属性“值”正在使用 nil 或不安全的 NSValueTransformer。

该实体有一个使用 nil 或不安全的 NSValueTransformer 的属性“值”。

关于ios - 核心数据错误切换到使用 "NSSecureUnarchiveFromData"或 NSSecureUnarchiveFromDataTransformer 的子类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59722771/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com