Our iOS apps Med Mnemonics, Med Abbreviations, and ICD9 Consult handle huge amounts of data – 1500+ memory tricks and aides, 13,000+ medical abbreviations, and 17,000+ medical diagnosis codes respectively – and provide instantaneous search. The key to doing so is the FTS3 extension to SQLite3 which enables fast, indexed search.
While updating both apps to support the new features of iOS 4.0 by compiling against the iOS 4.0 SDK, I discovered that compiling a custom build of SQLite3 (in my case, to enable FTS3) led to massive breakage when running on iOS 3.2 or earlier. I could continue to just use the iOS 3.2 SDK, but that would mean no fast task switching, among other problems. No good!
The solution is to use the systemwide sqlite3 library and load FTS3 as an extension. To do so:
- Download the sqlite-fts3-extension project I created, which includes the necessary files from the sqlite3 project.
- Include the project in your own. Add it as a dependency for your own target (so it will be built automatically) and drag the sqlite-3.6.23.1-fts3-ext.a product to your Link Binary with Libraries phase.
- In the class file before you load the database, add:
#import "RRFTS3ExtensionLoader.h"
at the top and add:
[RRFTS3ExtensionLoader loadFTS3];
somewhere before the database is opened.
