In my method, I declare some variables, including int blockCount;
. I call this method more than once. Using the Xcode debugger, I found out that after the second time the method was called, the value of blockCount
was set to 364265, while it was set to 2, just a few milliseconds earlier.
It's not a real problem, since I can just set it to 0 or any other number I'd like, but is it bad programming habit to have a certain variable declared over and over again? I'm quite new to programming, and I want to make sure I'm doing things the right way. :)