简体   繁体   中英

SQLite Code works on iPhone simulator, crashes on iPad

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?

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

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM