-4
我无法将Int的变量分配给UILabel,我该如何解决这个问题?无法将Int的变量分配给UILabel
进口的UIKit
类的ViewController:UIViewController的{
@IBOutlet var CoinCounterInt: UILabel!
@IBOutlet weak var CoinCounter: UILabel!
var coins = 0
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func Clicker(sender: AnyObject) {
coins += 1
CoinCounterInt = "\(coins)"
}
}
@NilsGarland我猜是因为你没有看太多。 –