user393964
user393964

Reputation:

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?

Upvotes: 4

Views: 1957

Answers (2)

Stack Overflow is garbage
Stack Overflow is garbage

Reputation: 247949

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.

Upvotes: -2

GreyHands
GreyHands

Reputation: 1794

Yes it is possible. You just need to add SQLite library to your project, and follow the SQLite C/C++ API.

Upvotes: 5

Related Questions