Skip to content

Sync export skips over well defined Transformable Attributes #591

@ghost

Description

Trying to define array in core data that will import / export with Sync. Defined attribute arrays as per core data documentation. The transformable attributes work fine in my app. They are just failing to import / export. Does Sync handle Transformable data.

Method #1) Loading data into core data . . .

    let newLocation = IARLocation(context: context)
    newLocation.uniqueID = UUID().uuidString
    newLocation.textDescription = "location 1"
    let gpsLocation: [Double] = [Double(1.0), Double(1.3)]
    newLocation.gps = gpsLocation
    newLocation.gpsLatitude = 1.0
    newLocation.gpsLongitude = 1.3

Method #1) Export output for Location entity . . .

"location": {
"gps_latitude" = 1;
"gps_longitude" = "1.3";
"location_image" = {
"image_filename" = "5BBD3652-0D52-41AD-A744-78CB9CBF9D83";
"image_path" = "";
"image_type" = png;
name = locationImage;
"text_description" = "Location Image";
"unique_id" = "5BBD3652-0D52-41AD-A744-78CB9CBF9D83";
};

Method #1) Core Data def
attached location core data def.png

Method #2) Loading data into core data . . .

    let newAddress = IARAddress(context: context)
    newAddress.uniqueID = UUID().uuidString
    newAddress.textDescription = "address 1"
    let gpsAddress: [NSNumber] = [NSNumber(5.0), NSNumber(5.8)]
    newAddress.gps = gpsAddress
    newAddress.gpsLatitude = 5.0
    newAddress.gpsLongitude = 5.8
    newAddress.city = "Whoville"
    newAddress.zipcode = "00000"
    newAddress.state = "WV"
    newAddress.apartment = "3C"
    newAddress.street = "Main"
    newAddress.number = "140303"
    newDoor.address = newAddress

Method #2) Export output for Location entity . . .

    address =         {
        apartment = 3C;
        city = Whoville;
        "gps_latitude" = 5;
        "gps_longitude" = "5.8";
        name = address;
        number = 140303;
        state = WV;
        street = Main;
        "text_description" = "address 1";
        "unique_id" = "91B70457-33DE-48F8-925A-67C6E0C09B58";
        zipcode = 00000;
    };

Method #2) Core Data def
attached address core data def.png

I currently have gpsLatatude and gpsLongitude defined as Doubles in my code data entity attributes just for verification purposes. I would much prefer to use transformable arrays.

Address core data def
Location core data def

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions