Iphone 将属性转换为NSString

Iphone 将属性转换为NSString,iphone,objective-c,ios,ipad,addressbookui,Iphone,Objective C,Ios,Ipad,Addressbookui,在我的通讯簿应用程序中,当我获取联系人的电子邮件id时,我会设置如下内容: ABMultiValueRef 0x2994e0 with 1 value(s) 0: null (0x3f5655e0) - xyz@gmail.com (0x2994b0) 如何获取字符串值,即仅获取 xyz@gmail.com 从上面的结果 谢谢发布您的代码。ABMultiValueRef。。。看起来像是一个数组,您可能正在将其转换为NSString // This is what you have curr

在我的通讯簿应用程序中,当我获取联系人的电子邮件id时,我会设置如下内容:

ABMultiValueRef 0x2994e0 with 1 value(s)
0: null (0x3f5655e0) - xyz@gmail.com (0x2994b0)
如何获取字符串值,即仅获取

 xyz@gmail.com
从上面的结果


谢谢

发布您的代码。ABMultiValueRef。。。看起来像是一个数组,您可能正在将其转换为NSString
// This is what you have currently (i.e. the multivalues)
ABMultiValueRef emailValues = ABRecordCopyValue(person, kABPersonEmailProperty);

// This is how you extract the first item from the multivalues:
CFStringRef cfEmailAddress = ABMultiValueCopyValueAtIndex(emailValues, 0);

// This is how you convert it to an NSString.
NSString *emailAddress = CFBridgingRelease(cfEmailAddress);