i keep getting an "expected expression" and expected ')' '}' in expression list how do i solve this.i have tried to solve it by removing the brackets but it still wont work.
import UIKit
import Firebase
import FirebaseDatabase
class SearchViewController: UIViewController {
@IBOutlet weak var tableView: UITableView!
var postData = [String]()
var ref: DatabaseReference!
var databaseHandle: DatabaseHandle?
override func viewDidLoad() {
super.viewDidLoad()
//let db = Firestore.firestore()
// Do any additional setup after loading the view.
ref = Database.database().reference()
databaseHandle = ref?.child("users").observe(DataEventType .childAdded, with: {
(snapshot) in
// code to execute when child added under users
let post = snapshot.value as? String
if let actualPost = post {
self.postData.append(actualPost)
self.tableView.reloadData()
) "expected expression"
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
)}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…