Quote:
Originally Posted by thomashw
Code:
NSInteger temp = 0;
And:
|
Whoa whoa whoa--huh? NSInteger++ doesn't make any sense. ++ IS the increment operator, but it can't be used after NSInteger because NSInteger is a variable type. It'd have to be something more like:
Code:
NSInteger temp;
temp++;
I prefer to use the normal "int" variable type, but to each his own, I guess.
And for your other question--no, you don't have to declare it in any different way than a variable that doesn't change. There are things called constants which can't change, ever--but declaring those is generally much different than just declaring a normal variable.
I'd look at some beginner's resources, starting, actually, with C--as Objective C is just a strict superset (that is, Objective C is like C plus other stuff). So you might consider picking up a cheap book on basic C, it will probably help you a lot.