swift - iOS 尝试显示 CNContactPickerViewController 时出错
怪我咯
怪我咯 2017-04-17 17:37:21
0
1
628

今天试了一下 iOS9 新加的 Contacts 和 ContactsUI ,在尝试显示 CNContactPickerViewController 时遇到了这个问题。

完整的信息如下:

2016-01-09 18:01:42.621 Mobile OA[3628:219885] plugin com.apple.MobileAddressBook.ContactsViewService interrupted

2016-01-09 18:01:42.623 Mobile OA[3628:219885] plugin com.apple.MobileAddressBook.ContactsViewService invalidated

2016-01-09 18:01:42.624 Mobile OA[3628:219557] viewServiceDidTerminateWithError:: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}

2016-01-09 18:01:42.625 Mobile OA[3628:219855] [CNUI ERROR] error calling service - Couldn’t communicate with a helper application.

2016-01-09 18:01:52.444 Mobile OA[3628:219557] [CNUI ERROR] Contact picker delayed appearance timed out - YES

出错代码:

let contactPicker = CNContactPickerViewController()

contactPicker.predicateForEnablingContact = CNContact.predicateForContactsInGroupWithIdentifier("547A3057-B39D-4BC1-83A2-41C27A5AAAD7:ABGroup")

presentViewController(contactPicker, animated: true, completion: nil)

其中 CNContact.predicateForContactsInGroupWithIdentifier("547A3057-B39D-4BC1-83A2-41C27A5AAAD7:ABGroup") 一行为为问题所在,注释即正常运行。

但这行代码应该是没问题的,Group identifier 确认有,组里有联系人,Predicate 也是用 CNContact 的类方法生成的。

有没有有这方面使用经验的人指点一下,哪里出了问题?还是说是个 Bug ?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
PHPzhong

Ah, I have always forgotten this question.

The final result of the research is a bug, can you believe it?

Now that the solution is not unclear, I won’t adopt this damn conclusion. Let’s wait and see when we know the solution or who finds a way to get around it. . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template