Hello all,
I'm the developer of REHex, a hex editor which I have been distributing as an app bundle outside of the app store for a few years.
REHex allows assigning various bits of metadata (comments, data types, etc) which get stored as filename.rehex-meta
alongside the original filename
, this works fine when the app is just a standalone bundle, however, when distributed via the app store, sandboxing seems to be mandatory, and there doesn't appear to be any obvious way to get permission to read/write such files.
As fallbacks, I've considered adding support for storing the metadata as an extended attribute instead (which breaks compatibility, and won't translate when the file is on a FAT/etc filesystem or network share), or popping up the save/load dialog a second time for the user to select a .rehex-meta
file, adding it to the list of whitelisted files for the application (keeps compatibility, but UX is clunky).
Are there any ways I can work around this, or perhaps other methods I should consider for storing the metadata in an Apple-tolerant manner?
Thanks
App Sandbox does have a facility for this sort of thing, but I’m concerned that it might not work for your specific use case. Specifically, it supports the notion of related files (NSIsRelatedItemType
). See the discussion in Use related file access to work with groups of files section of Accessing files from the macOS App Sandbox.
This is designed for folks working with specific document types. For example, imagine an app that opens .foomoov
files which might have an associated .foomoovsub
file containing subtitles. My concern in your case is that your app opens all types of files, and it’s not clear if the related files mechanism will work in that case.
Still, it’s worth you running some tests. My advice on that front is to start with the expected use case, that is, with a declared document type and a declared related file (.foomoov
and .foomoovsub
in the example above). Once you get that working you can try it out in the general case that you actually care about.
Lemme know if you run into any snags with this stuff. This is quite obscure. I’ve never had cause to create a test project for it, so I don’t have any specifics to share )-:
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"