title: addTarget doesn't work for UIButtons in iOS, view covered up
body: <p>I have two UIButtons I am creating programmatically and setting targets. If I add these buttons to a main view, everything works beautifully. However when I add the to a subview first and add this subview to the main view, touch events don't work. I'm guessing these buttons are being covered up.</p>
  
  <p>How can I uncover these buttons while keeping them inside the subview?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>// Create button panel here
  UIImage *buttonPanel = [UIImage imageNamed:@"left_button_background"];
  UIImageView *buttonPanelView = [[UIImageView alloc] initWithImage:buttonPanel];
  [buttonPanelView setFrame:CGRectMake(20, 186, 363, 345)];
  
  // Populate the panel with buttons
  UIButton *cmsButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 10, 351, 142)];
  [cmsButton setImage:[UIImage imageNamed:@"BTN_MATLIB"] forState:UIControlStateNormal];
  [cmsButton addTarget:self action:@selector(loadCMS) forControlEvents:UIControlEventTouchDown];
  [buttonPanelView addSubview:cmsButton];
  [self setCms:cmsButton];
  
  UIButton *calcButton = [[UIButton alloc] initWithFrame:CGRectMake(10, 196, 351, 142)];
  [calcButton setImage:[UIImage imageNamed:@"BTN_MORE_RESOURCES"] forState:UIControlStateNormal];
  [calcButton addTarget:self action:@selector(loadCalc) forControlEvents:UIControlEventTouchDown];
  [buttonPanelView addSubview:calcButton];
  [self setCalc:calc];
  
  [[self view] addSubview:buttonPanelView];
  </code></pre>