显示ABPersonViewController时出错

时间:2014-09-03 03:52:05

标签: ios abaddressbook abpersonviewcontroller

我像这样创建ABPersonViewController:

ABPersonViewController *picker = [[ABPersonViewController alloc] init] ;
picker.personViewDelegate = self;
picker.displayedPerson = person;
picker.displayedProperties=@[@(kABPersonPhoneProperty),@(kABPersonEmailProperty),@(kABPersonBirthdayProperty),@(kABPersonOrganizationProperty),@(kABPersonJobTitleProperty),@(kABPersonDepartmentProperty),@(kABPersonNoteProperty),@(kABPersonCreationDateProperty)];
// Allow users to edit the person’s information
picker.allowsEditing = YES;
picker.allowsActions=YES;

然后我从我的导航控制器推送该控制器并出现此错误:

Assertion failure in +[CNContact propertyForPropertyID:], /SourceCache/AddressBookUI_Sim/AddressBookUI-1553.3.50/Framework/Sources/CNUIContact/CNContact.m:862
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Failed to convert property ID "26" to CN property name'

我意识到这个错误,因为我添加了kABPersonCreationDateProperty,但我不知道为什么。有人可以解释一下吗?谢谢你

0 个答案:

没有答案