What takes up less memory when allocating: UIView or UIL开发者_运维知识库abel?
thanks
In the most abstract sense, UILabel would take more memory since it inherits from UIView.
But it really depends on what you're doing. I highly recommend that you do not attempt to replicate UILabel's functionality in a UIView. Since you do not appear to have an intimate understanding of the inner-workings of the UIKit framework, you would be doing it more inefficiently than the Apple engineers have.
Use what fits; what is easiest, and what works. It'll save you a lot more work in the long-run, especially if you write code that works well only with a certain implementation and then they end up changing implementations, etc.
精彩评论