Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Add .nosync to the file/folder name path and keep it in the home or documents directory. Problem solved.

edit: I'm shocked this thread is so long and no body mentioned this. It's been on the apple developer forums for months as a solution.



I haven't had a chance to verify this myself, but according to Marco, this does not actually avoid the iCloud sync:

https://twitter.com/#!/marcoarment/status/124587437799374848


It actually does. I know because I've been testing with our app. It works perfectly. We build up a fairly large 25MB sqlite db and it doesn't show in iCloud anywhere.

In fact, if you use UIManagedDocument, it creates a .nosync directory in the document bundle to prevent it from syncing in the framework itself.


The docs specifically say directory, not file. Maybe that is the problem?


Well that could use better publicity. Do you have a citation?

Has anyone used this successfully?


Do you have any documentation about this? I see a few scant references in the developer forum and nothing in the docs.


I moved our large data files from the library cache directory to a data.nosync directory in the documents directory. The data in the nosync folder is being backed up to iCloud.



From what I can tell the use case for .nosync there is to store a large dataset in a SQLite store in such a way that individual transactions are replicated to iCloud but the entire SQLite store itself is not transferred each time something changes.

The documentation seems to imply that .nosync will prevent the whole store from being uploaded, but (1) that does not seem consistent with what others are reporting, and (2) I cannot find any other supporting information on .nosync in either Apple documentation or dev forums - that doc and this thread are literally the only places I've seen it referenced.

The other underlying issue is whether Apple would be cool with storing persistent application data in Documents provided that it is not synced to iCloud. The use case that Marco and others have described does not really match what's described in that document.

edit: Marcos -> Marco


Can also store in the apps home directory (which is right above the apps Documents directory).

They spoke about .nosync at this year's WWDC a few times. Dev forums are a little nuts since they opened the iOS Beta 5 forums to all the non NDA members.


Watch the WWDC videos on Core Data.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: