在使用我的应用程序执行 Intent 扩展以启动视频通话时,我在日志中有以下错误消息:
2016-09-28 23:56:58.686343 CallIntentExtension[2442:128209] -[Swift._SwiftDeferredNSArray _dataForIntentSlotDescription:]: unrecognized selector sent to instance 0x143d29a50
2016-09-28 23:56:58.703162 CallIntentExtension[2442:128209] <NSXPCConnection: 0x143e3b2a0> connection from pid 25: Warning: Exception caught during invocation of received message, dropping incoming message and invalidating the connection.
Exception: -[Swift._SwiftDeferredNSArray _dataForIntentSlotDescription:]: unrecognized selector sent to instance 0x143d29a50
-[Swift._SwiftDeferredNSArray _dataForIntentSlotDescription:]: unrecognized selector sent to instance 0x143d29a50
(
0 CoreFoundation 0x000000019471c1d8 <redacted> + 148
1 libobjc.A.dylib 0x000000019315455c objc_exception_throw + 56
2 CoreFoundation 0x0000000194723278 <redacted> + 0
3 CoreFoundation 0x0000000194720278 <redacted> + 916
4 CoreFoundation 0x000000019461a59c _CF_forwarding_prep_0 + 92
5 Intents 0x00000001adde1dd0 <redacted> + 36
6 CallIntentExtension 0x00000001000179fc _TTRXFdCb_dCSo7NSArray_dT__XFo_oGSaCSo24INPersonResolutionResult__dT__ + 72
7 CallIntentExtension 0x000000010001748c _TFC19CallIntentExtension17CallIntentHandler15resolveContactsfT17
resolveContacts
在扩展开发开始之前,应用程序已更新到 swift 2.3。给 Siri 的消息是:“使用 AppName 到 ContactName 开始视频通话”。 解决方法被称为:
func resolveContacts(forStartVideoCall intent: INStartVideoCallIntent, with completion: ([INPersonResolutionResult]) -> Void)
成功解决结果提供给完成块:
var resolutionResults = [INPersonResolutionResult]()
let handle = INPersonHandle(value: "ContactName", type: .Unknown)
let person = INPerson(personHandle: handle, nameComponents: nil, displayName: "ContactName", image: nil, contactIdentifier: "123", customIdentifier: nil)
resolutionResults += [.success(with: person)]
completion(resolutionResults)
但是在日志中出现错误消息并且 Siri 说:“抱歉,您需要继续在应用程序中”。 不调用执行或处理方法。新的清除应用程序也会发生同样的情况。您可以在此处找到该项目。
请帮我理解什么是错的?有什么想法吗?
附言
我没有找到任何关于-[Swift._SwiftDeferredNSArray _dataForIntentSlotDescription:]:
聚苯乙烯
如果将应用程序转换为 Swift 3,错误就消失了。