I have to debug not my project and I see, that TwilioChatClient.chatClient method doesn't execute and I receive memory read failed error EXC_BAD_ACCESS (code=1, address=0x0). I saw similar topic, where advised to update Twilio, but it is installed via framework and I didn't find the instruction how to update twilio framework in the Xcode. Please help me. Here is the code:
/* Initialize client. */
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)
})
}
After the TwilioChatClient.chatClient line the program goes to the end of the function. Also I receive the chat token for twilio (it is printed in the console)