是否可以像苹果通讯录应用一样显示整个联系人列表?
有没有我可以使用的苹果用户界面?
或者我是否需要使用 ABAddressBook 复制完整的联系人并构建我自己的 ListView?
我知道有ABPeoplePickerNavigationController和ABPeoplePickerNavigationControllerDelegate
我已经通过以下代码使用了 Picker:
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self addContact];
}
-(void)addContact {
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentModalViewController:picker animated:NO];
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
return YES;
}
但实际上我不想打开 Picker。我需要将其设置为主视图,没有取消按钮。