I have an SQL schema that I need to feed to SQLite in my Objective-C command-line app. I’d like the schema to be a part of the binary, so that I can distribute just one file. Unlike a regular Mac or iOS app, the binary has no resource bundle, so the traditional way of storing resources inside the app bundle is out. Is there an elegant way to include the schema in the source? I know I can simply store it as a multiline string in a header, but that sucks.
Share
One interesting solution I have come up with is extended attributes. It’s possible to add a Run Script phase to the Xcode build process that does something like:
And then in runtime:
This way I can keep the schema in a separate file without mangling it into a header file. The obvious downside is that the extended attribute might not survive some file operations.