ksachdeva
ksachdeva

Reputation: 101

UIDocument or UIManagedDocument when the application's backing store is both file & core data database

I am bit confused regarding which class I should inherit from. My application currently creates files in the "Documents" folder and also has Core Data based data models. These data models contains more information about the files.

Now I am thinking to migrate the app to the document architecture and thereby integrating with iCloud at one of time.

I have started to think in the direction of using both i.e. using UIDocument to manage the files and UIManagedDocument to manage the Core Data.

Would appreciate if someone could guide me.

Upvotes: 0

Views: 429

Answers (1)

svena
svena

Reputation: 2779

It is perfectly acceptable to use both at the same time, as you said, for different purposes.

But consider, if those files are real documents and not just some data files of an internal implementation, I personally would not store any critical data about the documents separate from the documents though. Since documents from user perspective are meant to be self-sustaining - user may create, delete or move them around freely without fearing any interdependency with some other documents or objects. User expects all necessary meta-data to move with the document.

Then again if there is some "house-keeping" metadata that you can always re-create about your documents in the database, that is just fine.

Upvotes: 1

Related Questions