문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top