문제

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