What takes up less memory when allocating: UIView or UILabel?
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.