SyncKit icon indicating copy to clipboard operation
SyncKit copied to clipboard

CoreData URL/URI type fields not synced

Open nneubauer opened this issue 3 years ago • 3 comments

Hi again,

I encountered problem: My Core Data model contains a bunch of field of type (optional) URI which translate to NSManaged public var foo: URL?. Looking into the CloudKit dashboard after the initial sync all those fields are missing in the corresponding record type. Any idea why this is? Do I need to go with a Transformable instead for URLs?

Thanks!

nneubauer avatar Apr 02 '22 10:04 nneubauer

For reference, switching to Transformable with the custom type URL does work for me but the original question remains.

nneubauer avatar Apr 09 '22 12:04 nneubauer

Record properties must be of a type that conforms to CKRecordValueProtocol, which includes: Array(Conforms when Element conforms to CKRecordValueProtocol.) Bool CKAsset CKRecord.Reference CLLocation Data Date Double Float Int Int16 Int32 Int64 Int8 NSArray NSData NSDate NSNumber NSString String UInt UInt16 UInt32 UInt64 UInt8

Using Transformable is probably the best approach. Another option would be just storing them as Strings, or using CoreDataAdapterRecordProcessing to convert URL<->String at the point CKRecords are created.

mentrena avatar May 15 '22 13:05 mentrena

I added URL andothers in my BigSyncKit fork https://github.com/lake-of-fire/BigSyncKit which is still a bit WIP but I'm shipping to prod w/ it on ios and macos

aehlke avatar May 27 '23 19:05 aehlke