views:

437

answers:

2

This code works fine on the iPhone and the iPhone simulator, but crashes the simulator when running on the iPad:

const char *createsql = [MYClass GetDBCreationString];
sqlite3_stmt *crts;
if (sqlite3_prepare_v2(database, createsql, -1, &crts, NULL) == SQLITE_OK) {
    int success = sqlite3_step(crts);
    if (success != SQLITE_DONE) {
        ///problem
    }
    sqlite3_finalize(crts);
    sqlite3_reset(crts);
}

It's code to create the SQLLite table that will hold that specific class. It crashes on the reset line every time, but it does successfully create the table.

On the iPhone and iPhone simulator it works fine. Is the finalize and reset being redundant? If so, why does it crash on iPad but work fine on iPhone?

+4  A: 

The iPad SDK is under non-disclosure agreement. You should ask this question at the only place you can: http://devforums.apple.com

Dave DeLong
I was thinking it was more of an issue with my SQLite code, as I wasn't sure if I was doing something incorrectly with the reset/finalize statements that I shouldn't have been doing on the iPhone anyway.
mjdth
+1  A: 

I think the sqlite3_reset() is not needed; sqlite3_finalize() should do what you want. Is the version of SQLite the same on both simulators?

Ben Gottlieb