title: Custom UIControls with Storyboard
body: <p>I'm having trouble figuring this one out.  I have a custom UIControl class set up to hold a UIImage and UILabel, and my UITableViewCell class holds two of these UIControls (leftProduct, &amp; rightProduct)</p>
  
  <pre><code>@interface FeaturedProductControl : UIControl
  
  @property (strong, nonatomic) IBOutlet UIImageView *featuredProductPhoto;
  @property (strong, nonatomic) IBOutlet UILabel *featuredProductDescription;
  @property (strong, nonatomic) Product *featuredProduct;
  
  - (id)initWithProduct:(Product *)product;
  
  @end
  
  @interface FeaturedTableCell :  UITableViewCell
  
  @property (strong, nonatomic) IBOutlet FeaturedProductControl *leftProduct;
  @property (strong, nonatomic) IBOutlet FeaturedProductControl *rightProduct;
  
  @end
  </code></pre>
  
  <p>The images and labels are being filled in using the init method during cellForRowAtIndexPath, and they're coming through just fine.  I have a target action associated with the UIControls in the Storyboard, but the productClicked: method doesn't seem to be called.  I've tried changing it out to add the target action programmatically, no luck.</p>
  
  <p>However, if I add an alloc/init to the code, the productClicked: method triggers properly, but unfortunately the UILabel and UIPhoto now come up empty onscreen.  Since the UIControls are designed in Storyboard, I think I'm not supposed to do the alloc calls myself, but the TableViewController doesn't seem to like that it's not being called.  I've tried calling alloc within [[FeaturedTableCell alloc] init], but it had no effect.</p>
  
  <p>Contents of cellForRowAtIndexPath:
      cellIdentifier = @"Featured Row";</p>
  
  <pre><code>FeaturedTableCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
  
  if (cell == nil) 
  {
      cell = [[FeaturedTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
  }
  
  FeaturedRow *featuredRowData = [self.productIndexModel objectAtIndexPath:indexPath];  // This contains the necessary products to fill the Row
  
  Product *leftProduct = [featuredRowData.skuList objectAtIndex:0];
  
  cell.leftProduct = [[FeaturedProductControl alloc] initWithProduct:leftProduct];  // Actions trigger, but no data
  // cell.leftProduct = [cell.leftProduct initWithProduct:leftProduct];  // Data is filled in, but no action
  
  // [cell.leftProduct addTarget:self action:@selector(productClicked:) forControlEvents:UIControlEventTouchUpInside];  // the storyboard mapping works without this line of code
  
  if (featuredRowData.skuList.count &gt; 1)
  {
      Product *rightProduct = [featuredRowData.skuList objectAtIndex:1];
  
      cell.rightProduct = [cell.rightProduct initWithProduct:rightProduct];
  //     cell.rightProduct = [[FeaturedProductControl alloc] initWithProduct:rightProduct];  // Yes, these two are reversed from the left side code above for testing
      [cell.rightProduct addTarget:self action:@selector(productClicked:) forControlEvents:UIControlEventTouchUpInside];
  
      cell.rightProduct.hidden = NO;  // right side column is hidden in case the number of products is odd
  }
  else 
  {
      cell.rightProduct.hidden = YES;
  }
  
  [cell setNeedsLayout];
  
  return cell;
  </code></pre>
  
  <p>Any idea what I'm doing wrong?  I'm trying to keep as much of the initialization and setup as possible inside the storyboard, so I'd prefer not to go back to writing the whole UIControl programmatically.</p>
  
  <p>Thanks everyone!</p>