Q:

What is the correct way to re-use UILabel's style?

I have several UILabels which have same visual treatment. Instead of redefining every single property every time, I am thinking of just making copies of an instance and changing the text. Is this how it should be done?
Another way is to create a factory method, but I'm not that fond of the idea.

A:

If you're willing to learn Three20, you could use the TTLabel class, which is incorporated with Three20's stylesheet system, which is basically designed to solve your problem.  However, I personally have had trouble parsing Three20's so-called documentation, so I think learning to use this library just to solve your problem is a lot of overhead.
My work-around for this problem is to put together a mini factory method, like this:
// Example:
- (UILabel *)makeLabel {
  UILabel *label = [[[UILabel alloc] init] autorelease];
  label.backgroundColor = [UIColor clearColor];
  label.font = [UIFont systemFontOfSize:kMyFontSize];
  label.textColor = [UIColor blueColor];
  label.textAlignment = UITextAlignmentCenter;
  [self.view addSubview:label];
  return label;
}

Then when I use this method, other code gets cleaner:
UILabel *nameLabel = [self makeLabel];
nameLabel.text = userName;
UILabel *titleLabel = [self makeLabel];
titleLable.text = myTitle;
// Both labels have consistent style.

PengOne suggests subclassing UILabel.  That's an option, although I think this factory method does the job just as well with less work.

