我有两个问题:
let amount:String? = amountTF.text
Run Code Online (Sandbox Code Playgroud)
amount?.characters.count <= 0它给出了错误:
Binary operator '<=' cannot be applied to operands of type 'String.CharacterView.IndexDistance?' (aka 'Optional<Int>') and 'In
Run Code Online (Sandbox Code Playgroud)
let am = Double(amount)它给出了错误:
Cannot invoke initializer for type 'Double' with an argument list of type '(String?)'
Run Code Online (Sandbox Code Playgroud)
我不知道如何解决这个问题.