How to store NSDictionary as transformable properties in master data

I have an NSDictionary in which I wanted to store data in my main data model. How can i do this?

+6
source share
2 answers

Set the Transformable attribute, and it will automatically convert it to and from NSData. No need to manually archive, as in another answer.

+9
source

Use NSKeyedArchiver and save it in the data field in your database:

 NSData *data = [NSKeyedArchiver archivedDataWithRootObject:yourDictionary]; 
+8
source

Source: https://habr.com/ru/post/909480/


All Articles