Я пытаюсь подсчитать общее количество записей о днях рождения в адресной книге.
Строка проблемы
/* This line crashes only when using kABPersonBirthdayProperty */
ABMultiValueRef lBirthdays = ABRecordCopyValue(lRef, kABPersonBirthdayProperty);
/* Note that when this line is changed to another `ABPropertyID`, it works fine.
Only seems to crash on NSCFDates.
*/
Существует больше кода для перебора всех контактов на всем протяженииАдресная книга, но не имеет отношения к этому вопросу.
int totalBirthdayEntries = 0;
CFIndex lContactBirthdayCount = ABMultiValueGetCount( lBirthdays );
for (int births = 0; births < lContactBirthdayCount; births++)
{
totalBirthdayEntries++;
}
NSLog(@"Total Birthdays in Address Book: %i",totalBirthdayEntries);