如何将ABPeoplePickerNavigationController设置为MainView?

时间:2012-11-05 15:23:16

标签: objective-c ios xcode abpeoplepickerview

是否可以显示整个联系人列表,如苹果地址簿应用程序?
我可以使用苹果的UI吗? 或者我是否需要使用ABAddressBook复制完整的联系人并构建我自己的ListView?

我知道有ABPeoplePickerNavigationControllerABPeoplePickerNavigationControllerDelegate

我已经使用了这个代码的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。我需要将它设置为主视图,而不需要使用cancle按钮。

1 个答案:

答案 0 :(得分:0)

你不能只使用它的一部分(嗯......技术上你可以,但我不认为苹果会喜欢它:D)

你必须重复它,我担心