【发布时间】:2015-10-14 09:50:55
【问题描述】:
我有一个ABPeoplePickerNavigationController 如下
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
我需要禁用一些从 ABPeoplePickerNavigationController 的列表视图中选择的联系人。
浏览的时候,有这样的想法
// Predicate to enable only the contacts having a mail id atleast.
picker.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@"emailAddresses.@count > 0"];
所以我实现了一个如下的谓词来排除选择我的名字的联系人。
NSString *firstName = @"Kate";
// Predicate to disable selection of the contacts with the first name given.
picker.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@"firstName != %@",firstName];
不幸的是,它不起作用。
【问题讨论】:
标签: ios objective-c abpeoplepickerview