I'm trying to convert just ONE iPhone contact to a vCard using the build in methods. The docs say to use:

ABPersonCreateVCardRepresentationWithPeople(CFArrayRef people)

... but my delegate method gives me this:

- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person;

I can't figure out how to create a CFArrayRef with just a single ABRecordRef.

The docs pointed me to CFArrayCreate() which confused me even more. I don't know enough C to figure this out on my own. I read in SO that NSArray had something called toll-free bridging and should be interchangeable with CFArrayRefbut didn't quite understand how to use it since the compiler complained when I tried just swapping them.

有帮助吗?

解决方案

toll-free bridging:

where array is kind of class: NSArray

CFArrayRef arrayRef = (__bridge CFArrayRef)array;
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top