[FR] - Add Couchbase Lite db as Xcode resource


#1

I’m using Couchbase Lite in a couple of mobile apps. In order to “pre-fill” the database, I need to add the database bundle as an Xcode resource. Its file looks like e.g. myapp.cblite2, and is seen as a single file in the Finder and in Xcode, however it is actually a “package”/folder containing sqlite files and attachments, and this how Projucer sees it. When adding it to the project via Projucer, it causes errors as it adds the contents of the folder rather than the file/bundle. So I need to manually add it in Xcode instead - drag it into the project, and select “Create folder references”

Is there a way to get Projucer to see it as one file instead of a folder?


#2

Not really, because what actual bytes would that “bundle” contain? A bundle is literally just a folder, not some special file format.

Perhaps you should zip it, store the zip file in your binary data, and uncompress it when you need it?


#3

I had actually considered zipping it, and uncompressing it when needed, but doing it from the Objective-C code that will use it rather than via binary data.
Thanks for confirming.