What happens to external entries in NSPersistentDocument documents?

I just thought about using NSPersistentDocument, and in my data model I like to store some binary data.

Good, since 10.7 Core Data provides an external storage function . Does anyone know or even have tests (maybe some samples) what happens when you use it in conjunction with an NSPersistentDocument?

I think I read, if you put at least 1 MB of binary data, in it the main data will create a separate file and save only the link in the database. But what happens if you use it with an NSPersistentDocument? It would be nice for me if he created a package and managed external files in a folder.

Has anyone tried?

+4
source share
1 answer

I tried. It does not create a package. External data ends up in an invisible folder in the same directory as your document. It will not be copied, moved or deleted with the document, so you risk data loss when copying or moving the document.

I wrote a detailed answer to this one here .

+1
source

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


All Articles