I'm working on an iWatch application and I'm getting the following error:
'WKInterfaceLabel' does not have a member named 'text'
The outlet:
@IBOutlet var numField: WKInterfaceLabel!
Relevant code block which causes the error:
func updateDisplay() {
// If the value is an integer, don't show a decimal point
var iAcc = Int(accumulator)
if accumulator - Double(iAcc) == 0 {
numField.text = "\(iAcc)"
} else {
numField.text = "\(accumulator)"
}
Specifically:
numField.text = "\(iAcc)"
and
numField.text = "\(accumulator)"
I've tried optionals as suggested in other answers, but I am still having issues.