当我试图增加currentNumberAdmin
我得到:无法转换'UILabel!'类型的值预期参数“类型INOUT字符串”
cannot convert value of type 'UILabel!' to expected argument 'type in out String'
class adminPanel: UIViewController {
@IBOutlet weak var currentNumberAdmin: UILabel!
@IBAction func nextCurrent(_ sender: UIButton) {
let database = FIRDatabase.database().reference()
database.child("current").observe(FIRDataEventType.value, with: { (snapshot) in
self.currentNumberAdmin.text = snapshot.value as! String
currentNumberAdmin += String(1)
})
}
}
有谁知道我可以转换和正确地增加currentNumberAdmin
?
为什么要向视图添加字符串?你想达到什么目的? –