开发者

SQLite Code works on iPhone simulator, crashes on iPad

开发者 https://www.devze.com 2022-12-19 03:32 出处:网络
This code works fine on the iPhone and the iPhone simulator, but crashes the simulator when running on the 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开发者_JS百科, 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号