그룹 이름을 가져 오려고하는데이 메서드를 "연락처를 다시로드하기 위해 사용자가"호출하면 nil
값과 다음 오류가 발생합니다. 사용자가 여러 업데이트를 모든 시간을 할 경우ABAddressBookCreate(), ABAddressBookGetGroupCount, ... @ "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
그래서 난 아직도 그 때까지는 좋지 나는 addressbook
액세스 시간의 수를 감소하도록 수정 얻을 때 addressbook
알려 주시기 위해 기본 알림을 사용하지만, addrssbook
GET 수정 된 것은이 가벼운 천막 또는 addressbook
과 관련된 다른 하나를 호출해야합니다.
그래도 도움이 필요합니까 ??? ???
참조하십시오 http://stackoverflow.com/questions/13053976/catch-22 -에 대한 문서에 대한 설명 - 주소록 사용 - ios-6 – rmaddy
@rmaddy 같은 경우는 아니지만, 처음부터 모든 코드를 얻을 수 있지만 매번 재로드 버튼이 있습니다. 사용자가 20 번 이상 클릭하면 위의 오류가 반환됩니다. – Omarj
죄송합니다. 많은 반복 작업 후에 만 문제가 발생했다는 것을 깨닫지 못했습니다. – rmaddy