Why does my DateComponents object in iOS not save to or retrieve from CloudKit correctly?
问题 I am using CloudKit with Swift for iOS. I am saving an object of type DateComponents in a CloudKit field of type Bytes. When I retrieve the object, it does not have the same value as the object I originally saved. Here is the code where I save the object to CloudKit: let unsafePointer: UnsafePointer<DateComponents> = UnsafePointer<DateComponents>(&time) let unsafeBufferPointer: UnsafeBufferPointer<DateComponents> = UnsafeBufferPointer<DateComponents>(start: unsafePointer, count: 1) let data: