// // CCContact.m // CCFC // // Created by xichen on 11-12-16. // Copyright 2011年 ccteam. All rights reserved. // #import "CCContact.h" @implementation CCContact // 调用联系人界面 + (ABPeoplePickerNavigationController *) showAddressBookPeopleView:(id)delegate withId:(ABPropertyID)propertyId animated:(BOOL)animated { ABPeoplePickerNavigationController *peoplePicker = [ABPeoplePickerNavigationController new]; if(!peoplePicker) { return nil; } [peoplePicker setPeoplePickerDelegate:delegate]; //设置过滤属性 [peoplePicker setDisplayedProperties: [NSArray arrayWithObject:[NSNumber numberWithInt:propertyId]]]; //显示联系人界面 [delegate presentModalViewController:peoplePicker animated:animated]; [peoplePicker release]; return peoplePicker; } // 调用新建联系人界面 + (ABNewPersonViewController *)showNewPersonView:(id)delegate animated:(BOOL)animated { ABNewPersonViewController *newPersonVew = [ABNewPersonViewController new]; if(!newPersonVew) { return nil; } newPersonVew.newPersonViewDelegate = delegate; [delegate presentModalViewController:newPersonVew animated:animated]; [newPersonVew release]; return newPersonVew; } @end
googlecode链接地址(会有更新):http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCContact.m
本文提供了一种在iOS应用中调用系统联系人界面的方法,包括展示联系人列表及新建联系人的视图控制器。通过Objective-C实现,适用于需要集成联系人功能的应用开发。
289

被折叠的 条评论
为什么被折叠?



