Thoughts on persistence locations?


#1

This chapter and the previous chapter have raised a couple of questions for me, and I’m wondering if anyone else would like to put in their $0.02 worth. I noticed first in Chapter 29, that the “feed.db” was put in the local Documents directory, which brought up my first question: I thought the general practice was to put Core Data stores in the Library folder, since the file really isn’t something the user can do anything with (except delete). Am I wrong about that? Is that not a standard practice?

Then, in this chapter I see the transaction log files are going to be stored in the Ubiquity container, not the Documents Ubiquity container. The former isn’t available to the user (and that’s okay with me), but the latter is. So, I’m just wondering what you all think is the thinking behind these location decisions. Why have it stored locally where the user can get at it, but not in iCloud where the user can get at it? Am I missing something?

Right now, my preference would be to store both locally and in iCloud in a directory that the user can’t get to (that is, something other than the Documents folder). But then that raises another question for me: how, then, does the user delete those files? Let’s say I change the database model. That would mean the user would have to delete the app off of his or her device in order to get rid of the local files. But then what of the old files in iCloud?

Anyway, if I’m making sense, I’d be interested in what others think.

Also, for me, anyway, this has been a great book and I do thank the authors and this Board’s members.


#2

You might want to read Apple’s application sandboxing guidelines.


#3

Thanks for your reply, ibex10, let me go back and look at that. It’s been awhile…