If I have this in my .h
file:
int index;
And then in the .m
file I have:
if (index == nil)
The variable is technically undefined (may have any value) before you assign it a value. Most likely, it will be equal to zero. Also, both nil and NULL are defined to zero. However, this comparison is not recommended. You should only use nil when comparing pointers (it is not intended to be used with primitives).