Track changes to an external file

I completely followed the NSFilePresenter protocol using NSFileCoordinator to track external changes made to the imported folder / file tree. And it generally works.

However, I'm still a little confused.

  • I implemented almost all (if not all) protocol functions.
  • presentedSubitemDidChangeAtURL: presentedSubitemAtURL:didMoveToURL: and presentedItemDidChange are the only ones receiving the call
  • I can successfully track the addition of new folders or moving files. However, when switching to the content files of changes (edited and saved by another application), everything becomes a little more complicated: the method that needs to be called is presentedItemDidChange (which is also explicitly called in other cases)

What am I missing?

Shouldn't I call presentedItemDidGainVersion: or savePresentedItemChangesWithCompletionHandler: :?

Any help or pointers are more than welcome! :)

+6
source share

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


All Articles