title: UIView drawRect vs initWithFrame
body: <p>I have a UIView which has several buttons added to it as subviews. Currently I have the buttons in drawRect:, which I have heard is a bad idea because drawRect can be called several times. I tried to move these UIButtons to initWithFrame, but they just don't get drawn. How should I fix this?</p>
  
  <p>I am not using interface builder, so there are no NIB files present. The initWithFrame is called. I checked by adding an NSLog(...), and my NSMutableArrays are being properly initialized.</p>
  
  <p>My initWitFrame: code currently has very little. It is</p>
  
  <pre><code>- (id)initWithFrame:(CGRect)frame 
  {
      if (self = [super initWithFrame:frame]) 
      {
          results = [[NSMutableArray alloc] init];
          inputs = [[NSMutableArray alloc] init];
          format = [[NSDateFormatter alloc] init];
          [format setDateFormat:@"EEE, MMM dd, yyyy"];
          renc =[[RenameController alloc] init];
      }
      return self;
  }
  </code></pre>
  
  <p>I have tried to add a textlabel like the following</p>
  
  <pre><code>#define BOX_WIDTH 155.0
  #define BOX_OFFSET 45.00
  #define ROW_HEIGHT 27
  
  - (id)initWithFrame:(CGRect)frame 
  {
      if (self = [super initWithFrame:frame]) 
      {
          results = [[NSMutableArray alloc] init];
          inputs = [[NSMutableArray alloc] init];
          format = [[NSDateFormatter alloc] init];
          [format setDateFormat:@"EEE, MMM dd, yyyy"];
          renc =[[RenameController alloc] init];
  
          double row=0.0;
          [self makelabel:@"Start" at:CGRectMake(0, row, BOX_OFFSET, ROW_HEIGHT)];
      }
      return self;
  }
  
  -(void) makelabel:(NSString *) str at:(CGRect) rect
  {
      UILabel *title = [[UILabel alloc] initWithFrame:rect];
      title.text = str;
      title.textAlignment = UITextAlignmentLeft;
      title.textColor = [UIColor blackColor];
      title.backgroundColor = [UIColor clearColor];
      title.font = [UIFont boldSystemFontOfSize:FONT_SIZE];
      [self addSubview:title];
      [title release];
  }
  </code></pre>