Quote:
Originally Posted by benoitr007
Sorry, what do you mean? All these arrays are already properties, but this is in the init method, so we said it was okay that way, didn't we? And just by curiosity, why do you recommend making them properties for that short piece of code? Do you usually make all of your instance variables properties?
|
Oh, I didn't realize we were still talking about the init method. Sorry.
Is there a reason that you make instance variables for the enemiesLayer1, 2, etc? If you are releasing them right away, then those instance variables don't seem to be necessary. They could be local variables. If you intend to access them again later (not via the main array, I mean), then don't release them.
And yes, I do make properties for all of my instance variables. Using instance variables directly is just begging for memory problems.
Quote:
Originally Posted by benoitr007
Finally, another quick question: using the objectAtIndex: method for an array doesn't copy it or do anything to the retain count? So it's perfectly fine to do currentArray = [objectsArrays objectAtIndex:i]; every step?
|
Correct.