With CNContactPickerViewController in iOS 9.0, how to enable/disable single or multiple selection?

人走茶凉 提交于 2019-12-20 11:51:46

问题


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:


回答1:


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.



来源:https://stackoverflow.com/questions/32815260/with-cncontactpickerviewcontroller-in-ios-9-0-how-to-enable-disable-single-or-m

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!