0

名簿アプリで、連絡先のメールIDを取得すると、次のようになります。

ABMultiValueRef 0x2994e0 with 1 value(s)
0: null (0x3f5655e0) - xyz@gmail.com (0x2994b0)

文字列値を取得する方法、つまりのみ

 xyz@gmail.com

上記の結果から?

ありがとう

4

1 に答える 1

2
// 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);
于 2012-05-22T23:59:39.360 に答える