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;//默认操作为选择进入相应的应用程序,比如打电话就进入电话程序
}
委托方法:
-(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;//默认操作为选择进入相应的应用程序,比如打电话就进入电话程序
}
相关文章推荐
- AddressBookUI.Framwork应用之ABPersonViewController, ABUnknownPersonViewController,ABNewPersonViewContro
- 不同iOS系统版本下ABPeoplePickerNavigationController和ABAddressBook访问系统通讯录的区别
- AddressBookUI.Framwork应用之ABPersonViewController, ABUnknownPersonViewController,ABNewPersonViewContro
- 改变ABPeoplePickerNavigationController的UINavigationBar 颜色
- ABPeoplePickerNavigationController
- iOS - ABPeoplePickerNavigationController 获取手机通讯录信息
- 30.ios 8 访问通讯录兼容问题,ABPeoplePickerNavigationController
- ABPeoplePickerNavigationController
- 如何使用iOS AddressBook , ABPeoplePickerNavigationController
- [iOS]修改ABPeoplePickerNavigationController导航栏颜色
- ios 8 联系人ABPeoplePickerNavigationController
- ABAddressBook & AddressBook UI 文件介绍(IOS开发)
- iphone通讯录AddressBook.framework和AddressBookUI.framework的应用
- iOS 修改UIDocumentPickerViewController navigation bar buttons color
- iphone通讯录AddressBook.framework和AddressBookUI.framework的应用
- 【转】iPhone通讯录AddressBook.framework和AddressBookUI.framework的应用
- iOS手机联系人相关AddressBookUI.Framwork和AddressBook.Framework
- iphone通讯录AddressBook.framework和AddressBookUI.framework的应用
- AddressBook.Framework应用之ABAddressBookRef,ABRecordRef,ABMutableMultiValueRef,ABMultiValueRef
- 手机联系人相关AddressBookUI.Framwork和AddressBook.Framework