Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 如何摆脱[BoringSSL]nw_协议_BoringSSL_获取_输出_帧(1301)获取输出帧失败,xcode中的状态8196_Swift_Xcode_Firebase - Fatal编程技术网

Swift 如何摆脱[BoringSSL]nw_协议_BoringSSL_获取_输出_帧(1301)获取输出帧失败,xcode中的状态8196

Swift 如何摆脱[BoringSSL]nw_协议_BoringSSL_获取_输出_帧(1301)获取输出帧失败,xcode中的状态8196,swift,xcode,firebase,Swift,Xcode,Firebase,我有一个包含用户及其消息的数据库,但当我尝试将用户日期转换为预定义的tableview时。这是代码。我收到两条信息输出。标题中的一个以及TIC读取状态[2:0x0]:1:57 我在一定程度上检查了代码的输出 import UIKit import FirebaseFirestore class ChatsVC: UIViewController, UITableViewDelegate, UITableViewDataSource{ @IBOutlet weak var chat

我有一个包含用户及其消息的数据库,但当我尝试将用户日期转换为预定义的tableview时。这是代码。我收到两条信息输出。标题中的一个以及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()
        }
    }
 )}

}
我已经从原始文件中编辑了发布在这里的代码,但是留下了一大块代码,因为我只模糊地知道错误的来源。快照正确打印出来,但当它转换为recentChats.count时,它将打印0