Acces SQLite database with C++ on iOS?
Is it possible to acces the SQLite API on iOS using C++ instead of Objective-C? I'm working on a music sequencer and I think my best option is storing the notes in a SQLite database with an indexed measure column.
I need those notes to calculate my sound frames and C++ is recommended for real time audio processing. (I'm calculating the sine wave for each note.) I'm guessing that using C++ for the SQLite database would speed things up as well and that way I wouldn't have to switch from Obj-C to C++ all the time.
Any idea if this is possible, and any examples?
Any time you use a database, it's going to be much, much slower than the few cycles it might cost to call an Obj-C function from C++.
This is a premature optimization. Just access the database the easy way, and if and when it ever becomes a problem, you'll be in a much better position to fix it, because by then you'll know where the bottleneck is.
Yes it is possible. You just need to add SQLite library to your project, and follow the SQLite C/C++ API.