class var allowedTopLevelClasses : [AnyClass]
Overview 概要
This class provides a default Value
implementation for secure decoding. This class attempts to decode data into the classes listed within allowed
, which includes NSArray
, NSDictionary
, NSSet
, NSString
, NSNumber
, NSDate
, NSData
, NSURL
, NSUUID
, and NSNull
.
To archive or unarchive other classes that support NSSecure
, create a subclass and override allowed
to list the classes to transform.
To use NSSecure
with Core Data, use the name of this class, or the name of a subclass you implement, as the name of the transformer for an entity’s attribute within a Core Data Model. If you use your own transformer subclass, register it with your app before intializing your persistent container with Core Data.
For an example of subclassing NSSecure
, see Handling Different Data Types in Core Data, which has a Color
class that transforms UIColor
to NSData
and the reverse, to support archiving instances of UIColor
.