我必须调试不是我的项目,我看,TwilioChatClient.chatClient方法没有执行,我收到内存读取失败错误EXC_BAD_ACCESS(代码= 1,地址= 0x0)。我看到类似的主题,建议更新Twilio,但它是通过框架安装的,我没有找到如何在Xcode中更新twilio框架的说明。 请帮我。这是代码:
/ *初始化客户端。 * /
func client(withToken token: String, completion: @escaping (Bool, NSError?) -> Void) {
let accessManager = TwilioAccessManager(token: token, delegate: self)
TwilioChatClient.chatClient(withToken: token, properties: nil, delegate: self, completion: { (result, client) in
var success = false
var error: NSError? = nil
if let result = result {
if result.isSuccessful() {
if let client = client {
self.client = client
accessManager?.registerClient(client, forUpdates: { (token) in
client.updateToken(token, completion: { (result) in
if let error = result?.error {
app.alert(error: error)
}
})
})
success = true
}
}
}
if let e = result?.error {
error = e
} else {
error = NSError.with(description: "Ошибка подключения.".localized)
}
completion(success, error)
})
}
在TwilioChatClient.chatClient行之后,程序进入函数的末尾。我还收到twilio的聊天记号(它在控制台中打印)