Error when display ABPersonViewController

165 Views Asked by At

I create ABPersonViewController like this :

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;

And then i push that controller to from my navigation controller and got this error :

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'

I realize this error because i add kABPersonCreationDateProperty, but i don't know why. Can someone explain me about this?Thank You

0

There are 0 best solutions below