Ich versuche, Gruppen Name zu bekommen, aber nach langer Zeit diese Methode "vom Benutzer zu laden Kontakte laden" geben Sie die nil
Wert und den folgenden Fehler.ABAddressBookCreate(), ABAddressBookGetGroupCount, ... zurück @ "0x00000000 <nil>"?
-(void) getGroupsName
{
[groupsName removeAllObjects];
//address book object to interact with iPhone contacts.
ABAddressBookRef addressbook = ABAddressBookCreate();
//get groups count
CFIndex groupsCount = ABAddressBookGetGroupCount(addressbook);
//get all available groups as array
CFArrayRef allGroups = ABAddressBookCopyArrayOfAllGroups(addressbook);
for (int i = 0; i<groupsCount; i++) {
//get group of index=i from groups array
ABRecordRef group = CFArrayGetValueAtIndex(allGroups, i);
//get group name, I use __bridge_transfer to transfer from C to objective-c.
[groupsName addObject:(__bridge_transfer NSString*)ABRecordCopyCompositeName(group)];
}
CFRelease(allGroups);
CFRelease(addressbook);
}
//////////////////////////////////////////////////////////////
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 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 FROM ABGroup;: unable to open database file warning: Could not compile statement SELECT ROWID, Name, ExternalIdentifier, StoreID, NULL, NULL, NULL FROM ABGroup;: unable to open database file
So verwende ich die ursprüngliche Benachrichtigung, mich zu informieren, wenn addressbook
geändert bekommt Anzahl von Zeit zu verringern ich die addressbook
zugreifen, aber immer noch nicht gut durch die Zeit, wenn der Benutzer viele Update machen und jede Zeit addrssbook
get modifiziert muss dieses meathod oder irgendein anderes bezogen auf addressbook
nennen.
so brauchen Sie noch Ihre Hilfe ???
Bitte sehen Adresse http://stackoverflow.com/questions/13053976/catch-22 -nach der Dokumentation-für-Adressbuch-Verwendung-mit-ios-6 – rmaddy
@rmaddy es ist nicht der gleiche Fall, mein Code erhalten alle Kontakte beim ersten Mal und jedes Mal, aber ich habe Reload-Taste Wenn der Benutzer mehr als 20 Mal darauf klickt, wird der Fehler über – Omarj
zurückgegeben. Leider habe ich nicht bemerkt, dass Sie das Problem erst nach vielen Iterationen hatten. – rmaddy