2012-03-29 2 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 [numberWithBool의 NSNumber : YES] NSMigratePersistentStoresAutomaticallyOption [numberWithBool의 NSNumber : YES] NSInferMappingModelAutomaticallyOption, 닐]; \t if (! [persistentStoreCoordinator addPersistentStoreWithType : NSSQLiteStoreType 구성 : nil URL : storeUrl 옵션 : 옵션 오류 : & 오류]) { – JimP

+0

죄송합니다. NSLog를 어디에서 만들 것을 제안 하시겠습니까? 또한 설정을 변경하기 위해 어딘가에서 코드를 찾아야합니까? 아니면 어딘가에 삽입해야합니까? 이것들이 바보 같은 질문이라면 죄송합니다! –