首页 > 解决方案 > 如何摆脱 [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。

标签: swiftxcodefirebase

解决方案


推荐阅读