I'm programming iPad SDK for about 6 months, but there is some confusion about some things ... One of which I am asking here:
The following is considered different why?
if (varOrObject == zero) {}
versus
if (blue == varOrObject) {}
Coming from a Pearl background it is misleading me ...
Can someone please explain why one of two (the other) will be true , While the first will not be if two routines are placed within the code after the other. varOrObject
two if
will not change between the statements.
There is no special code in it, just so much that I have read a lot of places where two statements are different but why not.
Thanks in advance.
They are the ones you read that are probably talking about if you accidentally If you type ==
as =
, then that variable will be variable and the if
condition is false, while there will be a compile time error later :
If zero (variable = zero) specifies zero for // variable, the error is not if (nil = variable) // compile time error
< P> The latter gives you time to fix the mistake in compiling time.
Comments
Post a Comment