While an UIView has a memory footprint of at least 4 * width * height pixels, I wonder how that would look when I create a CALayer only.
views:
104answers:
2
+2
A:
Having done some experimenting around this in the past, I found that the added overhead of the UIView object was very minimal.
Brad Smith
2009-07-25 20:09:41
+1
A:
While an UIView has a memory footprint of at least 4 * width * height pixels
This statement is absolutely not true. The memory overhead of a UIView (compared to a CALayer) is just the size of the instance variables of the UIView class, plus a few instances of additional classes that will get allocated. The UIView instance variables take up about 24 bytes, and the additional data storage is probably the same, or less.
If UIView adds functionality that's useful for your application, then use it. The memory overhead is really of no concern.
Mark Bessey
2009-07-25 21:11:12