2012-03-29 10 views
0

Ich erhalte einen Fehler in meiner iOS App. Frustrierend ist es ein intermittierender Fehler - Die Aufgabe, die ich ausführe, arbeitet 5 oder 6 Mal hintereinander und stürzt dann unerwartet ab. Das Fehlerprotokoll schlägt einen Fehler beim Öffnen einer SQLite-Datenbank vor - vermutlich das Kerndatenmodell in meiner App. Xcode zeigt jedoch an, dass die Zeile, in der der Fehler auftritt, auf die Apple-Kontaktdatenbank zugreift. Also mir ist nicht klar, was passiert ist. Das Fehlerprotokoll ist unten. Kann irgendjemand die Ausgabe unten interpretieren und Licht ins Dunkel bringen?Vorübergehender Fehler beim Zugriff auf das Kerndatenmodell/die Kontaktdatenbank

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 

Der Code, den ich ausführen werde, wenn der Absturz auftritt ...

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

Antwort

0

Ich nehme an, Sie erklären adressBuch in der folgenden Art und Weise?

ABAddressBookRef addressBook = ABAddressBookCreate(); 
+0

Ja - gerade oben, wo ich * client. –

+0

Wenn Sie das Clientobjekt NSLog, tritt der Fehler zu diesem Zeitpunkt auf? Wenn dies der Fall ist, liegt das Problem wahrscheinlich daran, dass Ihre Migrationsoptionen in Ihrem persistenten Speicher festgelegt sind. \t NSDictionary * options = [NSDictionary dictionaryWithObjectsAndKeys: \t \t \t \t \t \t \t [NSNumber numberWithBool: JA], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool: JA], NSInferMappingModelAutomaticallyOption, nil]; \t if (persistentStoreCoordinator addPersistentStoreWithType: NSSQLiteStoreType Konfiguration: nil URL: storeUrl Optionen: Optionen Fehler: & Fehler]) { – JimP

+0

Entschuldigung, ich verstehe die Antwort nicht vollständig. Wo würdest du vorschlagen, dass ich einen NSLog erstelle? Sollte ich irgendwo nach dem Code suchen, um eine Einstellung zu ändern, oder muss ich sie irgendwo einfügen? Entschuldigung, wenn das dumme Fragen sind! –

Verwandte Themen