NSFileManager trashItemAtURL deadlocks inside NSFileCoordinator coordinateWritingItem

Dear Experts,

Should I use NSFileCoordinator coordinateWritingItemAtURL: around a call to NSFileManager trashItemAtURL: ?

What options should I pass - NSFileCoordinatorWritingForDeleting, or ...ForMoving, or something else?

I've attempted various combinations. If I don't use the NSFileCoordinator, then the change is not reflected in the Files app (open alongside my test app in iPad split screen mode). All attempts using NSFileCoordinator result in a deadlock inside trashItemAtURL - it is stuck waiting for a semaphore.

I do have a FilePresenter for this file, but I am passing it to the NSFileCoordinator's init so that should not lead to deadlock.

I believe I am doing everything on the main thread. The files are local, in the app's Documents directory.

Any ideas anyone?

NSFileManager trashItemAtURL deadlocks inside NSFileCoordinator coordinateWritingItem
 
 
Q