1
我想乘以一個乘數的文本字段,但我不斷收到下面的錯誤。誰能幫忙?使用Swift。乘以文本字段錯誤?
Binary operator '*' cannot be applied to operands of type 'Int?' and 'Double'
var Number1 = Int(weight.text!)
let lidocainemult = (1.5)
var lidoresult = Number1 * lidocainemult
lidocaine.text = NSString(format:"%d",lidoresult)as String;
您試圖乘以可選整數和雙精度。 –