即时通讯在我的iOS项目中实现callKit,我使用callDirectory扩展来阻止和识别Numbers,块部分工作正常,唯一的问题是当我尝试添加要识别的数字时: private func retrievePhoneNumbersToIdentifyAndLabels() -
private func retrievePhoneNumbersToIdentifyAndLabels() -> (phoneNumbers: [String], labels: [String])? { // retrieve list of phone numbers to identify, and their labels interDefaults?.synchronize() if let numbers = interDefaults!.string(forKey: "ident-numbers"){ if let identities = interDefaults!.string(forKey: "ident-identities"){ let formattedNumbers = numbers.characters.split{$0 == "*"}.map(String.init) let formattedIdent = identities.characters.split{$0 == "*"}.map(String.init) return (formattedNumbers, formattedIdent) } } return ([""], [""]) }
当我尝试重新加载扩展时它失败并出现错误:Error Domain = com.apple.CallKit.error.calldirectorymanager Code = 3“(null)”
通过一些测试,我发现通过用1个元素EXP:[“Spamm Caller”]的数组替换formattedIdent,扩展工作完美并且没有显示错误,但是当我使用具有多个元素的数组时,同样的错误显示出来.
我做错了什么?提前致谢
public enum Code : Int { public typealias _ErrorType = CXErrorCodeCallDirectoryManagerError case unknown case noExtensionFound case loadingInterrupted case entriesOutOfOrder case duplicateEntries case maximumEntriesExceeded case extensionDisabled @available(iOS 10.3, *) case currentlyLoading @available(iOS 11.0, *) case unexpectedIncrementalRemoval }
所以基本上未知==代码0和其他选项增加一个.这是您的分机在此日期之前尝试处理新数据时可以收到的错误的完整列表.