我在控制台中收到此错误,之后只有错误。错误以随机顺序出现。一些数据库更改并保存工作,直到出现错误。
我试图清理项目,从手机中删除应用程序并重新启动手机。在模拟器中它工作正常!我用3GS试了,效果很好,我刚用4/4S试了,同样的问题出现了!
日志:
CoreData: sql: BEGIN EXCLUSIVE
CoreData: annotation: getting max pk for entityID = 2
CoreData: annotation: updating max pk for entityID = 2 with old = 19 and new = 20
CoreData: sql: ROLLBACK
CoreData: annotation: total fetch execution time: 0.2242s for 1 rows.
CoreData: sql: SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZJIDSTR, t0.ZLASTUPDATED, t0.ZPHOTOHASH, t0.ZWAITINGFORFETCH, t0.ZVCARDAVATARREL, t0.ZVCARDTEMPREL FROM ZXMPPVCARDCOREDATASTORAGEOBJECT t0 WHERE t0.ZJIDSTR = ? LIMIT 1
CoreData: details: SQLite bind[0] = "XXXXXXXXXXXXXXXXX"
CoreData: annotation: sql connection fetch time: 0.0128s
CoreData: details: SQLite bind[11] = "oIBWsotpJjWH8MAgnj9H56UtxXk="
CoreData: sql: COMMIT
CoreData: annotation: Disconnecting from sqlite database due to an error.
CoreData: error: (1) I/O error for database at /var/mobile/Applications/EB102CE9-77A8-4360-8D4E-3EEB55D21E8F/Library/ClientDB/StoreContent/persistentStore. SQLite error code:1, 'cannot rollback - no transaction is active'
CoreData: annotation: Connecting to sqlite database file at "/var/mobile/Applications/EB102CE9-77A8-4360-8D4E-3EEB55D21E8F/Library/ClientDB/StoreContent/persistentStore"
CoreData: error: (14) unable to open database file
我唯一要做的就是:添加新实体,编辑属性。节省。我正在使用 UIManagedDocument。
从现在开始,我只会得到同样的错误,即无法打开数据库。我的代码中没有 fopen 。所以它不可能是文件描述符错过使用。