Question

I have a set of CGFloats used to dynamically calculate height and y-coords for arranging views in my viewDidLoad: method, and once those views are arranged the vars are no longer needed. I was just wondering if there was a way (or even a point) to remove temporary variables within a scope once they're no longer needed, similar to releasing allocations?

Was it helpful?

Solution

CGFloat is just a typedef of float. Local variables of type float live entirely on the stack and disappear when the function returns, so there is no need to do any housekeeping.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top