cocoa-touchuilabelsetneedsdisplaysetneedsdisplayinrect

Cocoa - iOS -Does updating the text property of a UILabel require setNeedsDisplay?


I am a newbie and I have a iOS project where I am setting the text property of a UILabel field.

self.nameLabel.text = @"abcd";

Question

My understanding based on some testing:

Thanks


Solution

  • A UILabel will do everything needed for updates when you set its text property. Same for its other properties (font, textColor, etc.) About the only thing you have to do manually (if you're not using IB) is set the frame.