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
- Do I need to invoke setNeedsDisplayInRect for the label for the new text value to be displayed ?
My understanding based on some testing:
- Without invoking setNeedsDisplayInRect, the the label's text was updated,
- but I want to know if it was a coincidence or is gauranteed that the the label will display the new value without explicitly invoking setNeedsDisplay
Thanks
A
UILabelwill do everything needed for updates when you set itstextproperty. 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 theframe.