Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/39.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 触点选择器不工作_Ios_Iphone - Fatal编程技术网

Ios 触点选择器不工作

Ios 触点选择器不工作,ios,iphone,Ios,Iphone,当用户点击电话号码时,我想在标签上显示联系人号码。但我的密码自动取第一个电话号码。我在用这个 - (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person { [self getPeopleContactProperties:person:0]; } - (void)peoplePickerN

当用户点击电话号码时,我想在标签上显示联系人号码。但我的密码自动取第一个电话号码。我在用这个

- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker  didSelectPerson:(ABRecordRef)person
{
    [self getPeopleContactProperties:person:0];
}

- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
{
    [self getPeopleContactProperties:person:identifier];
}

- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker;
{
    [self dismissViewControllerAnimated:YES completion:NULL];
}
- (void)getPeopleContactProperties :(ABRecordRef)person :(ABMultiValueIdentifier)identifier
{
     NSString *email;
       ABMultiValueRef emails = ABRecordCopyValue(person, kABPersonPhoneProperty);
    if (emails) {
        CFIndex index;
        if (identifier == 0) {
            index = 0;
        } else {
            index = ABMultiValueGetIndexForIdentifier(emails, identifier);
        }
        email = (__bridge NSString *) ABMultiValueCopyValueAtIndex(emails,index);
    }

    resultlabel.text =email;
}
if ([peoplePicker respondsToSelector:@selector(setPredicateForSelectionOfPerson:)])
{
     peoplePicker.predicateForSelectionOfPerson = [NSPredicate predicateWithFormat:@"%K.@count > 1", ABPersonPhoneNumbersProperty];
}