سؤال

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