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开发者_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?
精彩评论