2つのInt値をどのように比較しますか?私はエラーを取得するInt値が他のInt値よりも大きいか等しいかどうかを確認しますか?値?
if (current >= self.limit) {
value = amount
} else {
value = current * 10 + amount
if value > self.max! {
value = amount
}
}
:
Binary operator '>=' cannot be applied to operands of type 'Int' and 'Int?'
だろう何
let limit: Int?
let current: Int = Int(self.stringValue)!
しかし、私は(と以上)それらを比較してみてください:だから、私はこれを持っていますこれについて
オプションをアンラップします。 – matt