Show custom contact information

帅比萌擦擦* 提交于 2019-12-06 16:05:57

Here is how it should be done:

    ABUnknownPersonViewController *newPersonViewController = [[ABUnknownPersonViewController alloc] init];
    newPersonViewController.displayedPerson = [self personObject];
    [self.navigationController pushViewController:newPersonViewController animated:YES];

and than to respond to the [self personObject]

- (ABRecordRef)personObject {

    // Create a new Person object.
    ABRecordRef newRecord = ABPersonCreate();

    // Setting the value to the ABPerson object.
    //ABRecordSetValue(newRecord, kABPersonKindOrganization, @"Business Name", nil);    


    ABMutableMultiValueRef multiPhone = ABMultiValueCreateMutable(kABMultiStringPropertyType);
    ABMultiValueAddValueAndLabel(multiPhone, @"1-555-555-5555", kABPersonPhoneMainLabel, NULL);
    ABRecordSetValue(newRecord, kABPersonPhoneProperty, multiPhone,nil);
    CFRelease(multiPhone);


    return newRecord;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!