Note that there are some explanatory texts on larger screens.

plurals
  1. POABAddressBookCreate() , ABAddressBookGetGroupCount , ... return @"0x00000000 <nil>"?
    text
    copied!<p>I'm trying to get Groups Name but after many time call this method "by the user to reload contacts" it give the <code>nil</code> value and the following error.</p> <pre><code>-(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&lt;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 </code></pre> <p><strong>So I use the native notification to let me know when <code>addressbook</code> get modified to decrease number of time I access the <code>addressbook</code>, but still not good by the time if user make many update and every-time <code>addrssbook</code> get modified must call this meathod or any other one related to <code>addressbook</code>.</strong></p> <p>so still need your help ???</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload