您的位置:首页 > 产品设计 > UI/UE

AddressBookUI.Framwork应用之ABPeoplePickerNavigationController

2012-12-08 17:44 501 查看
必须设置委托ABPeoplePickerNavigationControllerDelegate,ab.peoplePickerDelegate=self;

委托方法:
-(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
{

//点击联系人详情里面的属性,对相应的属性做处理
ABMultiValueRef values=ABRecordCopyValue(person, property);

CFIndex ix=ABMultiValueGetIndexForIdentifier(values, identifier);

CFStringRef value=ABMultiValueCopyValueAtIndex(values, ix);
NSLog(@"%@",value);
CFRelease(values);
CFRelease(values);

//获取某个值的标识器

CFIndex identifie=ABMultiValueGetIdentifierAtIndex(values, ix);
NSLog(@"identifier=%ld",identifie);

//限制用户可以看到的属性

peoplePicker.displayedProperties=[NSArrayarrayWithObject:[NSNumbernumberWithInt:kABPersonEmailProperty]];

returnNO;//默认操作为选择进入相应的应用程序,比如打电话就进入电话程序
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: