LoginSignup
6
6

More than 3 years have passed since last update.

CoreDataでAttributeをTransformableにした際のエラー対処

Posted at

環境

Xcode 11.0
Swift 5.1

エラー

CoreDataでEntityのAttributeを Transformable として,シミュレータを走らせると

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

とエラーが出てしまいました。

解決策

エラーの出力通りに対処をおこないました。
XXX.xcdatamodeld で Typeを Transformable にしたAttributeを選び, Transformerを NSSecureUnarchiveFromDataTransformer とします。

スクリーンショット 2019-10-05 17.08.02.png

6
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
6