如何比较Int64和Int64

时间:2016-01-13 11:25:50

标签: ios swift compare int64

我正在研究Swift程序,现在我遇到了一个问题:

如何将Int64与Int64进行比较?

if(msgCount.value != msg.longLongValue){

错误:

Binary operator '!=' cannot be applied to operands of type 'Int64' and 'Int64'

1 个答案:

答案 0 :(得分:3)

您可以直接比较相等

试试这个,它会对你有所帮助:

let msgCount : Int64=100
let msg : Int64=101

if(msgCount != msg ){
    // perform your logic here.
}