swift - 如何摆脱 [BoringSSL] nw_protocol_boringssl_get_output_frames(1301) 获取输出帧失败,xcode 中的状态 8196
问题描述
我有一个包含用户及其消息的数据库,但是当我尝试将用户日期转换为预定义的表格视图时。这是代码。我收到两条消息输出。标题中的那个以及 TIC 读取状态 [2:0x0]: 1:57 。
我在某种程度上检查了代码的输出。
import UIKit
import FirebaseFirestore
class ChatsVC: UIViewController, UITableViewDelegate, UITableViewDataSource{
@IBOutlet weak var chatsTableView: UITableView!
var recentChats: [NSDictionary] = []
//TableViewDataSource
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
print ("here is the \(recentChats.count)")
return recentChats.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! RecentChatTableViewCell
let recent = recentChats[indexPath.row]
cell.generateCell(recentChat: recent, indexPath: indexPath)
return cell
}
//MARK: LoadRecentChats
func loadRecentChats() {
recentListener = reference(.Recent).whereField(kUSERID, isEqualTo: FUser.currentId()).addSnapshotListener({ (snapshot, error) in
guard let snapshot = snapshot else { return }
print ("snapshot count is \(snapshot.count)")
print ("\(snapshot)")
self.recentChats = []
if !snapshot.isEmpty {
let sorted = ((dictionaryFromSnapshots(snapshots: snapshot.documents)) as NSArray).sortedArray(using: [NSSortDescriptor(key: kDATE, ascending: false)]) as! [NSDictionary]
for recent in sorted {
if recent[kLASTMESSAGE] as! String != "" && recent[kCHATROOMID] != nil && recent[kRECENTID] != nil {
self.recentChats.append(recent)
}
}
self.chatsTableView.reloadData()
}
}
)}
}
我已经从原始文件中编辑了此处发布的代码,但留下了一大块,因为我只模糊地知道错误的根源。Snapshot 可以正确打印出来,但是当它转换为 recentChats.count 时,无论如何它都会打印 0。
解决方案
推荐阅读
- javascript - 如何从输入中获取图像的正确位置并使用 javascript 显示它?
- apache - 使用“.conf”文件使所有子域指向单个文件/文件夹
- pymongo - 'NoneType' 对象不可下标 pymongo
- javascript - 重置倒计时
- javascript - Merge multiple object values of array into 1
- foreach - ForEach 和 GeometryReader:儿童的可变高度?
- html - 关于 React js 的问题,但我不知道怎么问?
- pandas - 如何使用fuzzywuzzy将pandas列中的相似字符串合并在一起
- python - 如何找到 2 个列表的索引并根据它们的索引将它们合并为一个?
- javascript - 苗条的动画 - 从键控每个块中删除项目时不需要的重叠内容