If I have this in my .h
file:
int index;
And then in the .m
file I have:
if (index == nil)
The value of an integer that hasn't yet been assigned depends on its declaration - an int
with static storage duration is zero if you don't assign it anything else. An int
with automatic or allocated storage duration could have any value if you don't explicitly initialize it.
By the way, putting an object declaration in your header like that is bound to cause you pain later.