iOS11 Cannot open Core Data Binary stores with UIColor stored in Transformable Attributes
| Originator: | cyrus.b.uk | ||
| Number: | rdar://33895450 | Date Originated: | 15/8/2017 |
| Status: | Open | Resolved: | No |
| Product: | iOS | Product Version: | 11 |
| Classification: | Data Loss | Reproducible: | Yes |
Area:
Core Data
Summary:
Since iOS 11, my application can no longer open core data binary stores with UIColors stored in Transformable attributes.
This only seems to affect Binary stores, I tested with SQLLite store and the problem did not occur.
Steps to Reproduce:
Run the attached project twice
The project is a clean new project built in Objective C with Core Data added.
The persistent store lazy property was changed such that a Binary datastore is created instead of the default SQLLite
In addition on startup, an entity is created if not present, and accessed if it is.
Expected Results:
The application does not crash
Observed Results:
The application does crash with trace :
CoreDataTransformableAttribBug.binary, NSUnderlyingException=value for key 'NS.objects' was of unexpected class 'UIColor'. Allowed classes are '{(\n NSData,\n NSNumber,\n NSOrderedSet,\n NSDate,\n NSArray,\n NSDictionaryMapNode,\n NSString,\n NSUUID,\n NSSet,\n NSDictionary,\n NSURL,\n NSDecimalNumber,\n NSNull\n)}'.}";
NSUnderlyingException = "Can't read binary data from file";
}
Version:
iOS 11 with XCode Version 9.0 beta 5 (9M202q)
Notes:
Configuration:
Only occurs when NSBinaryStoreType type is used for Core Data persistent store.
OpenRadar extra
(Attached project to original, but project is on gitHub showing how to reproduce the bug here : https://github.com/seriouscyrus/CoreDataTransformableAttribBug ) . The bug is also present on MacOS
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!