[MacRuby-devel] Using an SQLite wrapper with macruby

Ruben Fonseca krani1 at 0x82.com
Wed Jan 5 10:29:57 PST 2011


Hi all.

I'm trying to build a MacRuby 0.8 app with XCode. I want to interact with
an exisitng Sqlite3 database. Since I don't want to package or mess with
any Rubygem, I decided to look into existing Objective-C Sqlite wrappers.

I've tried PLDatabase and fmdb, and failed with both. The code compiles and
the application runs, but when calling a C function what accepts a va_arg
argument list, my app receives a EXC_BAD_INSTRUCTION.

Example:

Objective-C function interface:

- (FMResultSet *)executeQuery:(NSString*)sql, ... {

Ruby code

db.executeQuery "SELECT * FROM call"

it receives the error on this C line inside the executeQuery function

va_start(args, sql);


Any hints? Do you recommend a simple way of interacting with a Sqlite3
app with macruby + xcode, without using any gems?

Thank you
Ruben


More information about the MacRuby-devel mailing list