-3
我连接了UILabel
和UIButton
,但仍然中止。请帮我解决这个问题。为什么这会在UIlabel上放弃?
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
counterLabel.text = "0"
// Do any additional setup after loading the view, typically from a nib.
}
var counterNum: Int = 0
@IBOutlet weak var counterLabel: UILabel!
@IBAction func Tap(_ sender: UIButton) {
self.counterNum += 1
self.counterLabel.text = String(self.counterNum)
}
}
究竟是什么问题?你有没有崩溃日志? – Larme
为什么包含'func didReceiveMemoryWarning'?请仅为您的问题添加_relevant_代码。 –
当它中止时,Xcode会显示什么? –