gpt4 book ai didi

ios - iOS 7 和 iOS 8 的人物选择器

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:01:42 26 4
gpt4 key购买 nike

<分区>

我有人员选择器在 ios 7 上工作,我正在尝试为 ios 8 添加兼容性。我已将这两种方法添加到一个方法中,但我收到一条错误消息,指出预期的标识符或之前的左括号上的“(” NSString *contactName。任何建议都会很棒!

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


NSString *contactName = CFBridgingRelease(ABRecordCopyCompositeName(person));
self.nameField.text = [NSString stringWithFormat:@"%@", contactName ? contactName : @"No Name"];


ABMultiValueRef phoneRecord = ABRecordCopyValue(person, kABPersonPhoneProperty);
CFStringRef phoneNumber = ABMultiValueCopyValueAtIndex(phoneRecord, 0);
self.phoneField.text = (__bridge_transfer NSString *)phoneNumber;
CFRelease(phoneRecord);


ABMultiValueRef email = ABRecordCopyValue(person, kABPersonEmailProperty);
CFStringRef emailField = ABMultiValueCopyValueAtIndex(email, 0);
self.emailField.text = (__bridge_transfer NSString *)emailField;
CFRelease(email);

CFDataRef photo = ABPersonCopyImageData(person);
UIImage* image = [UIImage imageWithData:(__bridge NSData*)photo];
if(photo)
CFRelease(photo);
if(image)
self.myImageView.image = image;
[self dismissViewControllerAnimated:YES completion:nil];
return NO;
}

-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier
{
[self dismissViewControllerAnimated:YES completion:nil];
return NO; }

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com