File copied to iCloud Drive changes ownership to containing folder's app

Has anyone seen this problem with iCloud Drive?


If you copy a file, for example a jpg or png, into a folder in iCloud Drive, say for example Sketch, and if you double click on that file inside the Sketch folder, does Sketch launch trying to open up that file? The Finder should launch the default application for the file, not the application who the iCloud Drive folder belongs to.


Here's why it's a problem for me. My app allows a customer to attach photos, audio recordings, drawings, or basically any kind of file to a field in a database record. When they want to view that file, I use NSWorkspace to open up the file using whatever default application is assigned to that file type. Now, with El Capitan, it tries to open up my app simply because the file attachment is stored in my app's iCloud Drive container folder. But I'm trying to hand off responsibility for opening the app to the app's default owner.


And it's not just my app that's doing this. Even just copying a file from the Finder into an iCloud Drive app's folder will cause this phenomenon. If you press command-i to bring up the Get Info panel, you'll see that the "Open With" popup button has been changed to the containing folder's app. If you try to change it back to the default owner, it won't switch.


I've filed a radar on this issue already: rdar://22213595


If anyone can confirm this is expected behaviour that would be helpful to know.


It would also be helpful to know how I can work around this?


Thanks,


Brendan

Replies

Does anyone know a workaround to this issue? I haven't found one yet other than to maybe stop supporting iCloud Drive.