【发布时间】:2017-10-28 11:19:41
【问题描述】:
我有两个问题:
let amount:String? = amountTF.text
amount?.characters.count <= 0
报错:
Binary operator '<=' cannot be applied to operands of type 'String.CharacterView.IndexDistance?' (aka 'Optional<Int>') and 'In
let am = Double(amount)
报错:
Cannot invoke initializer for type 'Double' with an argument list of type '(String?)'
我不知道如何解决这个问题。
【问题讨论】: