Text bounds

iPhone SDK Tips & Tricks

myLabel.text = newText;
CGRect bounds = myLabel.bounds;
bounds.size = [newText sizeWithFont:myLabel.font];
myLabel.bounds = bounds;