访问核心数据模型/联系人数据库的间歇性错误 [英] Intermittent error accessing core data model / contacts database

查看:96
本文介绍了访问核心数据模型/联系人数据库的间歇性错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的iOS应用中出现错误。令人沮丧的是,这是一个间歇性错误 - 我正在执行的任务连续工作5或6次然后意外崩溃。错误日志表明打开sqlite数据库时出错 - 可能是我的应用程序中的核心数据模型。但是,Xcode显示发生错误的行是访问Apple联系人数据库。所以我不清楚发生了什么。错误日志如下。任何人都可以解释下面的输出并对此有所了解吗?

I am getting an error in my iOS app. Frustratingly, it is an intermittent error - The task I am performing works 5 or 6 times in a row then crashes unexpectedly. The error log suggests an error opening a sqlite database - presumably the core data model in my app. However Xcode shows that the line in which the error occurs is accessing the Apple contacts database. So I am not clear what has happened. The error log is below. Can anyone interpret the output below and shed any light on this?

    warning: Could not compile statement PRAGMA journal_mode = wal;: unable to open database file
error 14 creating properties table: unable to open database file
warning: Could not compile statement SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;: unable to open database file
warning: Could not compile statement SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;: unable to open database file
warning: Could not compile statement SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;: unable to open database file
warning: Could not compile statement SELECT ROWID, First, Last, Middle, NULL, NULL, NULL, Organization, NULL, NULL, Kind, NULL, NULL, Nickname, Prefix, Suffix, FirstSort, LastSort, CreationDate, ModificationDate, CompositeNameFallback, NULL, StoreID, NULL, FirstSortSection, LastSortSection, FirstSortLanguageIndex, LastSortLanguageIndex, NULL, NULL, NULL, PersonLink, NULL, IsPreferredName FROM ABPerson;: unable to open database file
warning: Could not compile statement SELECT ROWID, First, Last, Middle, NULL, NULL, NULL, Organization, NULL, NULL, Kind, NULL, NULL, Nickname, Prefix, Suffix, FirstSort, LastSort, CreationDate, ModificationDate, CompositeNameFallback, NULL, StoreID, NULL, FirstSortSection, LastSortSection, FirstSortLanguageIndex, LastSortLanguageIndex, NULL, NULL, NULL, PersonLink, NULL, IsPreferredName FROM ABPerson;: unable to open database file
warning: Could not compile statement INSERT OR REPLACE INTO _SqliteDatabaseProperties VALUES (?, ?);: unable to open database file
warning: Could not compile statement SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;: unable to open database file
warning: Could not compile statement INSERT OR REPLACE INTO _SqliteDatabaseProperties VALUES (?, ?);: unable to open database file
2012-03-29 11:43:13.813 iPT[10500:11303] Error loading /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/DataClassMigrators/AccountMigrator.migrator/AccountMigrator:  dlopen(/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/DataClassMigrators/AccountMigrator.migrator/AccountMigrator, 265): no suitable image found.  Did find:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/DataClassMigrators/AccountMigrator.migrator/AccountMigrator: open() failed with errno=24
2012-03-29 11:43:13.814 iPT[10500:11303] [+[AccountsManager _migrateAccountsIfNeeded]] Accounts migration failed
warning: Could not compile statement SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;: unable to open database file
warning: Could not compile statement SELECT value FROM _SqliteDatabaseProperties WHERE key = ?;: unable to open database file
warning: Could not compile statement SELECT ROWID, First, Last, Middle, NULL, NULL, NULL, Organization, NULL, NULL, Kind, NULL, NULL, Nickname, Prefix, Suffix, FirstSort, LastSort, CreationDate, ModificationDate, CompositeNameFallback, NULL, StoreID, NULL, FirstSortSection, LastSortSection, FirstSortLanguageIndex, LastSortLanguageIndex, NULL, NULL, NULL, PersonLink, NULL, IsPreferredName FROM ABPerson WHERE ROWID = ?;: unable to open database file

我正在执行的代码发生崩溃是......

The code I am executing when the crash occurs is...

Client *client = [mutableFetchResults objectAtIndex:loop];
            ABRecordID recordID = [client.addressBookID intValue];
            ABRecordRef person = ABAddressBookGetPersonWithRecordID (addressBook,recordID);
            NSString *clientFirstName = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty);
            NSString *clientLastName = (NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
            NSString *clientCompositeName = [NSString stringWithFormat:@"%@ %@", clientFirstName, clientLastName];


推荐答案

我假设您以下列方式声明addressBook?

I assume you are declaring addressBook in the following manner?

    ABAddressBookRef addressBook = ABAddressBookCreate();

这篇关于访问核心数据模型/联系人数据库的间歇性错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆