mentrena / SyncKit

Automatic CloudKit synchronization
https://mentrena.github.io/SyncKit/
MIT License
507 stars 59 forks source link

transformable attributes sync fix for NSSecureUnarchiveFromDataTransformer #181

Closed BlixLT closed 2 years ago

BlixLT commented 2 years ago

As mentioned in #177 - NSSecureUnarchiveFromDataTransformer use "reversed" methods from basic ValueTransformers: transformedValue:is being used when unarchiving Data and reverseTransformedValue:- when archiving some object to Data. So, I suggest this code to fix #177 crash

mentrena commented 2 years ago

@BlixLT thanks for the PR, it's been helpful in understanding the problem. The fix doesn't require different logic for NSSecureUnarchiveFromDataTransformer though, it has more to do with the fact that the calls to transformedValue and reverseTransformedValue were flipped, so I'll fix that in https://github.com/mentrena/SyncKit/pull/182