Sto cercando di ottenere Nome gruppo ma dopo molte chiamate questo metodo "dall'utente per ricaricare i contatti" fornisce il valore nil
e il seguente errore.ABAddressBookCreate(), ABAddressBookGetGroupCount, ... return @ "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
Così uso la notifica nativo di farmi sapere quando addressbook
ottenere modificato per diminuire il numero di tempo accedo al addressbook
, ma ancora non va bene per il momento se l'utente fare molti aggiornamenti ed ogni tempo addrssbook
get modificato deve chiamare questo meathod o qualsiasi altro relativo a addressbook
.
quindi hai ancora bisogno del tuo aiuto ???
Vedere http://stackoverflow.com/questions/13053976/catch-22 -accordo-alla-documentazione-per-indirizzo-libro-uso-con-ios-6 – rmaddy
@rmaddy non è lo stesso, il mio codice ottiene tutti i contatti alla prima volta e ogni volta ma, ho il pulsante di ricarica quando l'utente fa clic più di 20 volte restituisce l'errore sopra – Omarj
Mi spiace, non mi ero reso conto che avevi il problema solo dopo molte iterazioni. – rmaddy