With CNContactPickerViewController in iOS 9.0, how

2019-03-15 07:03发布

The delegate CNContactPickerDelegate have methods for single and multiple selections. But how do we specify we want single or multiple selection when we present the view controller?

I guess I miss something that perhaps also causes the problem I have described in: CNUI ERROR Selection predicates are set but the delegate does not implement contactPicker:didSelectContact:

标签: contacts ios9
1条回答
放荡不羁爱自由
2楼-- · 2019-03-15 07:54

You need to implement ONLY the method you need.

If you want only one contact, implement:

contactPicker:didSelectContact:

If you want multiple selection, implement:

contactPicker:didSelectContacts:

If you want select one property for one contact, implemente:

contactPicker:didSelectContactProperty:

And the last one, don't know how work, looks like a bug, because if I implement it, I get the multiple contact selection UI, but can't select properties.

contactPicker:didSelectContactProperties:

EDIT: Finally I got some data from didSelectContactProperties, this method required a definition in predicateForSelectionOfProperty. I think the name is incorrect, should be didSelectContactsProperties, because I got the properties for multiple contacts.

查看更多
登录 后发表回答