的參數列表,我有兩個問題:不能調用類型 '雙' 初始化與類型 '(字符串?)'
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?)'
我不知道如何解決這個問題。