Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreData URL/URI type fields not synced #178

Open
nneubauer opened this issue Apr 2, 2022 · 3 comments
Open

CoreData URL/URI type fields not synced #178

nneubauer opened this issue Apr 2, 2022 · 3 comments

Comments

@nneubauer
Copy link

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
Copy link
Author

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

@mentrena
Copy link
Owner

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.

@aehlke
Copy link

aehlke commented May 27, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants