I store colours in my core data model using transformable attributes. Starting iOS11, this no longer works and I get an error like :
... returned error Error Domain=NSCocoaErrorDomain Code=259 "The file couldn’t be opened because it isn’t in the correct format." UserInfo={NSUnderlyingException=Can't read binary data from file, NSUnderlyingError=0x60000005cb00 {Error Domain=NSCocoaErrorDomain Code=259 "The file “<Persistent store name>” couldn’t be opened because it isn’t in the correct format." UserInfo={NSFilePath=<Path to persistent store>, NSUnderlyingException=value for key 'NS.objects' was of unexpected class 'UIColor'. Allowed classes are '{(
NSDictionaryMapNode,
NSSet,
NSDictionary,
NSOrderedSet,
NSDecimalNumber,
NSUUID,
NSNumber,
NSNull,
NSData,
NSDate,
NSURL,
NSString,
NSArray
)}'.}}} with userInfo dictionary {
NSUnderlyingError = "Error Domain=NSCocoaErrorDomain Code=259 \"The file \U201cEmpty.rag\U201d couldn\U2019t be opened because it isn\U2019t in the correct format.\" UserInfo={NSFilePath=<Path to persistent store>, NSUnderlyingException=value for key 'NS.objects' was of unexpected class 'UIColor'. Allowed classes are '{(\n NSDictionaryMapNode,\n NSSet,\n NSDictionary,\n NSOrderedSet,\n NSDecimalNumber,\n NSUUID,\n NSNumber,\n NSNull,\n NSData,\n NSDate,\n NSURL,\n NSString,\n NSArray\n)}'.}";
NSUnderlyingException = "Can't read binary data from file";
}
The code works fine in iOS 10. I basically just set the attribute to a transformable type in the object model. And specify UIColor (Or NSColor for OSX) in the class property type.
Is there a new step or will this functionality no longer be supported?