Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FinderSync: beginObservingDirectoryAtURL is not always called

I'm implementing a Finder Sync extension, and have encountered some weird issues with my FIFinderSync implementation.

The callback beginObservingDirectoryAtURL is not always called. Usually, when its not called its for the first or second level under my root folder.

Has anyone encountered a similar issue? Anyway to enforce the callback that I may be missing?

like image 471
Mugen Avatar asked Sep 10 '15 07:09

Mugen


1 Answers

I'm currently encountering a similar problem.

What I determined is that the Finder Sync Extension will deallocate and re-allocate my FIFinderSync object while my extension's process is running. This can happen if my application disables and then re-enables the extension at startup. It can also happen if the user disables and then re-enables the extension while its process is running.

To diagnose this, I suggest adding logging to your FIFinderSync object's init and dealloc methods. Make sure that objects that hold references to your FIFinderSync use weak references, so you know that your FIFinderSync is being properly deallocated.

Also, your FIFinderSync will need to tolerate recovering its connections back to your product in its second, third, ect, re-init. This was my ultimate problem: my extension wasn't recovering the connection already made back into the product's main process.

like image 179
Andrew Rondeau Avatar answered Nov 15 '22 13:11

Andrew Rondeau