4

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?

4

2 回答 2

5

对的,这是可能的。您只需将 SQLite 库添加到您的项目中,并遵循SQLite C/C++ API即可。

于 2012-04-10T21:25:13.813 回答
-1

每当您使用数据库时,它都会比从 C++ 调用 Obj-C 函数可能花费的几个周期慢得多。

这是一个过早的优化。只需以简单的方式访问数据库,它成为问题时,您将处于一个更好的位置来修复它,因为到那时您将知道瓶颈在哪里。

于 2012-04-10T21:25:25.787 回答