开发者

kABPersonRelatedNamesProperty

开发者 https://www.devze.com 2023-01-07 22:47 出处:网络
I find the Apple documentation extensive but I also find guidance on the syntax for code lacking i开发者_运维百科n explanation or examples.

I find the Apple documentation extensive but I also find guidance on the syntax for code lacking i开发者_运维百科n explanation or examples.

Is there any reference books/documents on coding the address book in general and for my specifics the Related Name Property in the ABPeoplePickerNavigationController Class available?


Just for information to people who is searching the same term and looking for simple example:

ABMultiValueRef relatedNames = ABRecordCopyValue(person, kABPersonRelatedNamesProperty);
NSMutableArray *relatedNameList = [[[NSMutableArray alloc] init] autorelease];

for(CFIndex j = 0; j < ABMultiValueGetCount(relatedNames); j++) 
{
    NSString *relatedNameLabel = [(NSString*)ABMultiValueCopyLabelAtIndex(relatedNames, j) autorelease];
    if (relatedNameLabel == nil) 
    {
        relatedNameLabel = @"";
    }
    NSString *relatedNameString = [(NSString*)ABMultiValueCopyValueAtIndex(relatedNames, j) autorelease];
    if (relatedNameString == nil) 
    {
        relatedNameString = @"";
    }
    NSArray *relatedNameArray = [NSArray arrayWithObjects: relatedNameLabel, relatedNameString, nil];
    [relatedNameList addObject:relatedNameArray];
}


Look at that -

http://developer.apple.com/library/mac/#documentation/userexperience/Conceptual/AddressBook/AddressBook.html%23//apple_ref/doc/uid/10000117i

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号