I am trying to get the home email property of a contact. It works fine, but I'm not sure if I check whether or not I correctly check if the home email property is nil
.
//Since there are multiple email labels, I iterate through them and check which one matches the string "Home" and that is the home email
if([emailLabel isEqualToString:@"Home"]){
//Here is where I check if there is actually a home email value
if ((__bridge_transfer NSString *)ABMultiValueCopyValueAtIndex(emailsMultiValueRef, emailsCount) != NULL){
email = (__bridge_transfer NSString *)ABRecordCopyValue(currentPerson, kABPersonEmailProperty);
}
//If the email property does not exist
else{
email = @"NULL";
}
}
My question is this: in this line if ((__bridge_transfer NSString *)ABMultiValueCopyValueAtIndex(emailsMultiValueRef, emailsCount) != NULL)
, do I compare the value copied as a string to nil
or NULL
? I'm not sure if the nil value checking is currently working.
Thanks in advance!