3 Replies
      Latest reply on Nov 13, 2019 11:54 AM by Jupp
      Jupp Level 1 Level 1 (0 points)

        On iOS 13 for transformable attributes that have no custom Transformer class set this appears in the console:


        "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."


        This message appears on devices, in the simulator on High Sierra it even leads to a crash.


        However, setting the transformer class to NSSecureUnarchiveFromDataTransformer when using CoreData CloudKit, this crashes and leads to Core Data not being initialized.


        Disabling CloudKit, e.g. setting the .cloudKitContainerOptions on the store description to nil fixes this crash.


        It seems CoreData CloudKit does not support NSSecureCoding transformers yet, right?

        If that's the case, I don't know why this appears in the console. Is this just a bug?


        To experience this for yourself, make an Xcode project with Core Data CloudKit and a transformable attribute, e.g. type [String: Int] in the model. Then set NSSecureUnarchiveFromData as the transformer for this attribute and try to start the app using this Core Data model with CloudKit enabled, meaning the Core Data Stack uses NSPersistentCloudKitContainer. In this case the Core Data model won't initialize.


        I'm not that familiar with the different transformer classes, maybe I'm just doing something wrong? Without CloudKIt enabled it seems to work though!