简体   繁体   English

SQLite Code在iPhone模拟器上运行,在iPad上崩溃

[英]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: 这段代码在iPhone和iPhone模拟器上可以正常工作,但是在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. 这是创建将保存该特定类的SQLLite表的代码。 It crashes on the reset line every time, but it does successfully create the table. 每次它都会在重置行上崩溃,但是它确实成功创建了表。

On the iPhone and iPhone simulator it works fine. 在iPhone和iPhone模拟器上,它可以正常工作。 Is the finalize and reset being redundant? 完成和重置是否多余? If so, why does it crash on iPad but work fine on iPhone? 如果是这样,为什么它在iPad上崩溃但在iPhone上可以正常工作?

The iPad SDK is under non-disclosure agreement. iPad SDK已达成保密协议。 You should ask this question at the only place you can: http://devforums.apple.com 您应该在唯一可以询问的地方提出这个问题: http : //devforums.apple.com

I think the sqlite3_reset() is not needed; 我认为不需要sqlite3_reset(); sqlite3_finalize() should do what you want. sqlite3_finalize()应该做您想要的。 Is the version of SQLite the same on both simulators? 两个模拟器上的SQLite版本是否相同?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序在iPhone / iPod上运行良好,但在iPad(甚至模拟器)上崩溃 - App works fine on iPhone/ iPod but crashes on iPad (even simulator) 应用程序在iPhone上崩溃,但在模拟器或iPad上没有崩溃? - App crashes on iPhone but not simulator or iPad? ReactNative - 模拟器工作,iPhone崩溃 - ReactNative - Simulator works, iPhone crashes 使用UITableView的应用程序在iPad模拟器上运行,但在iPhone模拟器上崩溃 - App with UITableView runs on iPad simulator but crashes on the iPhone simulator 模拟器iPad Pro(适用)与iPhone 6 Plus - Simulator IPad pro (works) vs iPhone 6 plus 应用在模拟器上崩溃。 适用于iPhone设备 - App crashes on simulator. Works on iphone device 代码可在iPhone模拟器上运行,但不能在设备上运行 - Code works on iPhone simulator but not on the device UICollectionView布局在iPad上崩溃,但在iPhone上运行良好 - UICollectionView layout crashes on iPad, but works fine on iPhone 应用程序可在iPhone上运行,但在iPad模拟器上崩溃,并停留在ipad上的启动图像上 - App works on iPhone but crash on iPad simulator stuck with launch image on ipad NSNotificationCenter代码可在iPhone中使用,但不能在iPad上使用 - NSNotificationCenter Code works in iPhone but not on iPad
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM