1
我有一個ABPeoplePickerNavigationController
如下的ABPeoplePickerNavigationController謂詞用於使接觸的選擇與predicateForEnablingPerson
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
我需要禁用一些觸頭的從的ABPeoplePickerNavigationController的列表視圖中選擇的。
在瀏覽時,得到了一些想法這樣
// Predicate to enable only the contacts having a mail id atleast.
picker.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@"[email protected] > 0"];
所以,我實現了一個謂語像下面排除與我的第一個名字接觸的選擇。
NSString *firstName = @"Kate";
// Predicate to disable selection of the contacts with the first name given.
picker.predicateForEnablingPerson = [NSPredicate predicateWithFormat:@"firstName != %@",firstName];
不幸的是,它不工作。