osx - Prevent original files from OS X app's sandbox container to be modified via drag and drop or Share Extensions? -
i have shoebox type (as opposed document based) os x app stores images in app's sandbox container.
these images can shared via share extensions (in form of nsurl) or exported via drag , drop.
when image shared image editor (e.g. acorn offers share extension), or dropped on image editor, image editor opens file from within sandbox container , can alter, rename or delete file - can lead kinds of inconstancies in app.
first, surprised, because thought, files in sandbox can accessed app itself. seems not case, when intentionally share nsurl.
so how can prevent can alter files in sandbox container while still offering them drag , drop , share extensions?
- i tried not sharing nsurls nsimages, many share extensions not work nsimages, not option.
- is possibility write-protect files in sandbox?
- should make copy of image temporary location, before offer sharing or drag , drop (could slow big images?)
i happy hear suggestions or learn more problem.
create bookmark of nsurl.
so user can still rename, move , delete file, notice , know new location , name , still able access file. should work if it's outside sandbox. can handle this. https://developer.apple.com/library/mac/documentation/cocoa/reference/foundation/classes/nsurl_class/
that's 1 of benefits working nsurl , not simple path string.
Comments
Post a Comment