2012-03-29 12 views
0

私のiOSアプリケーションでエラーが発生しました。挫折して、断続的なエラーです。私がやっている仕事は5,6回連続して起こり、突然クラッシュします。エラーログは、sqliteデータベース(おそらく私のアプリのコアデータモデル)を開く際のエラーを示唆しています。しかし、Xcodeは、エラーが発生した行がAppleの連絡先データベースにアクセスしていることを示しています。だから私は何が起こったのか分かりません。エラーログは以下のとおりです。誰もが下の出力を解釈し、これに任意の光を当てることができますか?コアデータモデル/連絡先データベースにアクセスする断続的なエラー

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 

クラッシュが発生したときに、私は実行していたコード...

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]; 

答えて

0

私はあなたが次のようにアドレス帳を宣言していると仮定?

ABAddressBookRef addressBook = ABAddressBookCreate(); 
+0

はい - *クライアントを宣言するところのすぐ上にあります。 –

+0

クライアントオブジェクトをNSLogすると、その時点でエラーが発生しますか?その場合は、移行ストアが永続ストアに設定されている可能性があります。 \t NSDictionaryの*オプション= [NSDictionaryのdictionaryWithObjectsAndKeys: \t \t \t \t \t \t \t【のNSNumber numberWithBool:YES]、NSMigratePersistentStoresAutomaticallyOption、[するNSNumber numberWithBool:YES]、NSInferMappingModelAutomaticallyOption、ゼロ]。 \t if(![persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType設定:なしURL:storeUrlオプション:optionsエラー:&error]){ – JimP

+0

謝罪、私はその答えを完全に理解していません。どこでNSLogを作成することをお勧めしますか?また、設定を変更するためにどこかのコードを探したいのですか、どこかに挿入する必要がありますか?これらがばかな質問であれば謝罪してください! –

関連する問題