CoreData crash error Xcode 11 Beta, IOS 13 Beta

Александр Бардашевский picture Александр Бардашевский · Jul 22, 2019 · Viewed 13.7k times · Source

Im trying building my application from Xcode11 beta on phone IOS 13 Beta. I have crash when application loading.

2019-07-22 13:58:12.910460+0300 GoodWine[3738:792501] [error] fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.

CoreData: fault: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.

2019-07-22 13:58:12.910595+0300 GoodWine[3738:792501] [error] CoreData: One or more models in this application are using transformable properties with transformer names that are either unset, or set to NSKeyedUnarchiveFromDataTransformerName. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead. At some point, Core Data will default to using "NSSecureUnarchiveFromData" when nil is specified, and transformable properties containing classes that do not support NSSecureCoding will become unreadable.

CoreData: warning: Property 'value' on Entity 'SFMCKeyValueEntity' is using nil or an insecure NSValueTransformer. Please switch to using "NSSecureUnarchiveFromData" or a subclass of NSSecureUnarchiveFromDataTransformer instead.

Answer

SirOz picture SirOz · Aug 9, 2019

I found this solution. The errors have disappeared and it would seem to work. I keep testing.

For all Transformable attributes, I have set “Transformer” to “NSSecureUnarchiveFromData” in the Data Model Inspector panel.

enter image description here

EDIT:

After a few days of testing I add something to my previous solution.

The previous solution works if, after the changes, the application is deleted. Otherwise, the data model is not recognized and is created from scratch, losing all the historical information (and in production this is not acceptable!!!).

The final solution I adopted was to add these changes to a new model (following this link) and implementing the migration (always described in the link).

In this case the warning appears only once after the update and then disappears.