QED
QED

Reputation: 9913

CoreFoundation references and AddressBook programming

If want to check if a person record has email addresses. So:

ABMultiValueRef emailMultiValue = ABRecordCopyValue(person, kABPersonEmailProperty);

If the record has no email addresses, do I get a NULL value in emailMultiValue, or some other special CFTypeRef value?

Upvotes: 0

Views: 43

Answers (1)

Vlad Papko
Vlad Papko

Reputation: 13302

You do not get NULL value cause of kABPersonEmailProperty record returns multi value type.
Actually it returns valid object with empty list of values:
NSLog(@"%@", emailMultiValue) -> ABMultiValueRef 0x156bbb00 with 0 value(s)

Upvotes: 1

Related Questions