Closed bryan1anderson closed 2 years ago
@bryan1anderson, your assumption is correct. This is a deliberate design decision. For encoding/decoding, you should be able to use the rawValue
which is a string. For reference, please checkout example Encoder/Decoder in the ExampleApp.
Error Domain=NSCocoaErrorDomain Code=134060 "A Core Data error occurred." UserInfo={NSUnderlyingError=0x282e77330 {Error Domain=NSCocoaErrorDomain Code=4866 "The data couldn’t be written because it isn’t in the correct format." UserInfo={NSUnderlyingError=0x282e772a0 {Error Domain=NSCocoaErrorDomain Code=4864 "This decoder will only decode classes that adopt NSSecureCoding. Class 'PREditorContentName' does not adopt it." UserInfo={NSDebugDescription=This decoder will only decode classes that adopt NSSecureCoding. Class 'PREditorContentName' does not adopt it.}}}}}
PREditorContentName assuming is the issue? Do you recommend something else for CoreData, like saving the string as data?