我曾經看到這樣 if (something == 0){do it}
條件,但 現在我已經在iOS_BookObjC如果(零== S){}
if (nil == s)
滿足這句話是這一樣if (s == nil)
,如果沒有,有什麼不同?
我曾經看到這樣 if (something == 0){do it}
條件,但 現在我已經在iOS_BookObjC如果(零== S){}
if (nil == s)
滿足這句話是這一樣if (s == nil)
,如果沒有,有什麼不同?
是的他們是同一件事 – Fonix
不,我已經鏈接的問題不只是關於'NULL',@PhilipKendall,並且涉及的特定常量與答案無關。 「爲什麼'if(3 == x)'?」有同樣的答案。 –
我會推薦測試falsey值,如: if(!s)或if(!something) – cncool