Kal , , "ABMultiValueCopyValueAtIndex" .
(, )
, , 1 , " ". "1", "0".
, , :
int index = ABMultiValueGetIndexForIdentifier(emails, identifier);
:
if (property == kABPersonEmailProperty) {
ABMultiValueRef emails = ABRecordCopyValue(person, property);
NSString *count = [NSString stringWithFormat:@"Count: %d Identifier: %d", ABMultiValueGetCount(emails), identifier];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"alert" message:count delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
if(ABMultiValueGetCount(emails) > 0)
{
int index = ABMultiValueGetIndexForIdentifier(emails, identifier);
CFStringRef emailTypeSelected = ABMultiValueCopyLabelAtIndex(emails, index);
CFStringRef emailTypeSelectedLocalized = ABAddressBookCopyLocalizedLabel(ABMultiValueCopyLabelAtIndex(emails, index));
CFStringRef emailValueSelected = ABMultiValueCopyValueAtIndex(emails, index);
self.lblEmailType.text = (NSString *) emailTypeSelected;
self.lblEmailTypeLocalized.text = (NSString *) emailTypeSelectedLocalized;
self.lblEmailValue.text = (NSString *) emailValueSelected;
}
[ self dismissModalViewControllerAnimated:YES ];
return NO;
}
return YES;