[英]save CMTime in core data + Xcode8 + swift3
Transformable need to be convertible to NSData
. Transformable 需要可转换为
NSData
。 When you're using a type that conforms to the NSCoding
protocol, that happens automatically.当您使用符合
NSCoding
协议的类型时,这会自动发生。 When you're not (as with CMTime
), you can't use a transformable unless you create your own custom transformer by subclassing NSValueTransformer
.当您不是时(与
CMTime
),除非您通过子类化NSValueTransformer
创建自己的自定义转换器,否则不能使用可转换。
You may find it easier to simply save the CMTime
properties in Core Data and reconstruct the CMTime
from those.您可能会发现简单地将
CMTime
属性保存在 Core Data 中并CMTime
重建CMTime
更容易。 The properties are all numeric types that Core Data knows how to handle.属性都是 Core Data 知道如何处理的数字类型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.