gpt4 book ai didi

ios - JSQ消息 : When I use photo messages my apps keeps crashing

转载 作者:行者123 更新时间:2023-11-28 09:36:33 25 4
gpt4 key购买 nike

我正在构建一个聊天应用程序,它使用 JSQMessagesViewController 来显示图像并使用 Firebase 作为后端。
该应用程序仅在使用文本消息时运行而不会崩溃,但是当我添加照片消息时。照片消息已添加到 Collection View 中,但是当我尝试添加照片消息时,我的应用程序在 finishSendingMessage() 上崩溃。

请帮忙:)

Function

Error

Console

最佳答案

有两种方法可以停止崩溃。第一种是在viewdidload中设置这段代码self.inputToolbar.contentView.leftBarButtonItem = nil此代码隐藏了消息 View 左侧的图像附件按钮。另一种方法是实现库提供的方法

 override func didPressAccessoryButton(sender: UIButton!) {
print("imageTapped")
}

还要确保在 nsdata 中转换图像

关于ios - JSQ消息 : When I use photo messages my apps keeps crashing,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38667686/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com