2016-01-13 102 views
-2

我在Swift程序上工作,現在出現問題:如何將Int64與Int64進行比較

如何比較Int64和Int64?

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

錯誤:

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

試試這個,如果([msgCount.value比較: msg.longLongValue] == NSNotFound)或者if([msgCount.value isEqual:msg.longLongValue])。 –

+0

如果(![msgCount.value isEqual:msg.longLongValue]),請嘗試此操作 –

+0

您必須標記該語言的問題......大概很快? – Wain

回答

3

您可以直接比較平等

試試這個,它會幫助你:

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

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