Documents in the Cloud on macOS

21 views
Skip to first unread message

Brendan Duddridge

unread,
Jun 18, 2016, 5:40:54 PM6/18/16
to Couchbase Mobile
I was just watching the WWDC 2016 session Crafting Modern Cocoa Apps and they mentioned that with the new macOS Sierra version, local copies of documents could get moved out from underneath you up to the user's cloud storage.

They suggest a few things:

Register as a NSFilePresenter to ensure that the document isn't evicted out from under you.
Use NSFileCoordinator to coordinate reading and writing.
File coordination will make sure the file is downloaded and up to date.

I'm just wondering how Couchbase would handle this situation? If the underlying database file gets moved, that would be a bad thing.

Should the opening of the database file use an NSFilePresenter to prevent the file from being evicted while it's open?

Thanks,

Brendan

Jens Alfke

unread,
Jun 25, 2016, 5:12:35 PM6/25/16
to mobile-c...@googlegroups.com

On Jun 18, 2016, at 5:40 PM, Brendan Duddridge <bren...@gmail.com> wrote:

I was just watching the WWDC 2016 session Crafting Modern Cocoa Apps and they mentioned that with the new macOS Sierra version, local copies of documents could get moved out from underneath you up to the user's cloud storage.

I haven’t watched the session or looked at the APIs yet, but I’m pretty certain this would only happen to user-visible documents, not to files in Application Support, which is where CBL databases usually live.

AFAIK, you’re the only person who’s treating CBL databases as regular documents. You should probably read up on this new feature…

—Jens
Reply all
Reply to author
Forward
0 new messages