Adding vCard data directly to the system Address Book

后端 未结 3 907
悲&欢浪女
悲&欢浪女 2021-02-03 11:42

I am designing a QR code reader, and it needs to detect and import contact cards in vCard format (.vcf).

is there a way to add the card data to the system Address Book d

3条回答
  •  星月不相逢
    2021-02-03 12:05

    Carter Allen's answer worked for me except that it caused my app to crash on the final statement CFRelease(book);

    It turns out that the CFRelease(person); statement should be removed. Doing so stopped my app from crashing. See this answer for explanation https://stackoverflow.com/a/1337086/881103

    Also checkout The Create Rule and The Get Rule sections on this page https://developer.apple.com/library/mac/#documentation/CoreFoundation/Conceptual/CFMemoryMgmt/Concepts/Ownership.html

提交回复
热议问题