IOS AddressBook не получает все телефонные номера из списка контактов

Я используюAddressbook в моем приложении IOS, чтобы получить имя контакта и номера, но происходит странная вещь, что он показывает номер телефона некоторых контактов.

Я надеялся, что он покажет весь список контактов с номером телефона.

так вот мой код для получения телефонных номеров:

-(void)getAddressbookData
{
    #if __IPHONE_OS_VERSION_MIN_REQUIRED < 60000
        ABAddressBookRef addressBook = ABAddressBookCreate();
    #else
        CFErrorRef *error = nil;
        ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, error);
    #endif
        NSArray * people;
        BOOL accessGranted = [self __addressBookAccessStatus:addressBook];

        if (accessGranted)
        {
            people = (__bridge_transfer NSArray*)ABAddressBookCopyArrayOfAllPeople(addressBook);
            // Do whatever you need with thePeople...
        }
        CFIndex nPeople = ABAddressBookGetPersonCount(addressBook);
        NSMutableArray *contactArray = [[NSMutableArray alloc] init];

        for (CFIndex i = 0; i < nPeople; i++)
        {
            ABRecordRef record = CFArrayGetValueAtIndex((__bridge CFArrayRef)(people), i);
            NSString *firstName = (__bridge NSString *)ABRecordCopyValue(record, kABPersonFirstNameProperty);
            NSString *lastName = (__bridge NSString *)ABRecordCopyValue(record, kABPersonLastNameProperty);
            NSString *fullName = nil;

            if (ABPersonGetCompositeNameFormat() == kABPersonCompositeNameFormatFirstNameFirst)
                fullName = [NSString stringWithFormat:@"%@ %@", firstName, lastName];
            else
                fullName = [NSString stringWithFormat:@"%@, %@", lastName, firstName];

            [contactArray addObject:fullName];

            //
            // Phone Numbers
            //
            ABMutableMultiValueRef phoneNumbers = ABRecordCopyValue(record, kABPersonPhoneProperty);
            CFIndex phoneNumberCount = ABMultiValueGetCount( phoneNumbers );

            NSMutableArray *numbersArray = [[NSMutableArray alloc] init];
            for ( CFIndex k=0; k<phoneNumberCount; k++ )
            {
                CFStringRef phoneNumberLabel = ABMultiValueCopyLabelAtIndex( phoneNumbers, k );
                CFStringRef phoneNumberValue = ABMultiValueCopyValueAtIndex( phoneNumbers, k );
                CFStringRef phoneNumberLocalizedLabel = ABAddressBookCopyLocalizedLabel( phoneNumberLabel );
                // converts "_$!<Work>!$_" to "work" and "_$!<Mobile>!$_" to "mobile"

                // Find the ones you want here
                //
               // NSLog(@"-----PHONE ENTRY -> name:%@ :  %@ : %@", fullName, phoneNumberLocalizedLabel, phoneNumberValue );
                [numbersArray addObject:CFBridgingRelease(phoneNumberValue)];

                CFRelease(phoneNumberLocalizedLabel);
                CFRelease(phoneNumberLabel);
                CFRelease(phoneNumberValue);
            }

           // NSLog(@"phone numbers %@", numbersArray);
            [contactDictionary setObject:numbersArray forKey:fullName];

            CFRelease(record);

        }

        selectContacts = contactArray;
       // NSLog(@"dictionary of array %@", contactDictionary);

        //NSLog(@"contacts count %d", [selectContacts count]);
    }

    -(BOOL)__addressBookAccessStatus:(ABAddressBookRef) addressBook
    {
        __block BOOL accessGranted = NO;

        if (ABAddressBookRequestAccessWithCompletion != NULL) { // we're on iOS 6
            dispatch_semaphore_t sema = dispatch_semaphore_create(0);

            ABAddressBookRequestAccessWithCompletion(addressBook, ^(bool granted, CFErrorRef error) {
                accessGranted = granted;
                dispatch_semaphore_signal(sema);
            });

            dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
            // dispatch_release(sema);
        }
        else { // we're on iOS 5 or older
            accessGranted = YES;
        }
        return accessGranted;
    }

так что numbersArray пусто для некоторых контактов, я не знаю, почему это происходит.

Ответы на вопрос(3)

Ваш ответ на вопрос