title: UITableViewCell rotate lags/hangs if I set UIImage as background view
body: <p>I am setting a UIImage, via a UIImageView as my background view of a subclassed UITableViewCell like so:</p>
  
  <pre><code>-(void)awakeFromNib {
  
  UIImage *backImg = [[UIImage imageNamed:@"CellBackground"]  
                      resizableImageWithCapInsets:UIEdgeInsetsMake(16, 132, 16, 16)];
  UIImageView *imv = [[UIImageView alloc] initWithImage:backImg];
  self.backgroundView = imv;
  
  }
  </code></pre>
  
  <p>This works excellently, each cell is different in height (exposed via heightForRowAtIndexPath which calculates the height of a UILabel with text in it), and the background image resizes as I want the cell to. </p>
  
  <p>However, when I rotate the device, the view hangs mid rotate, and takes 5-10 seconds to redraw in landscape, or crashes with no error. If I remove this imageview from the backgroundView, the rotate works excellently. Both simulator and device.</p>
  
  <p>[Edit] Alternatively, I added the imageview as a subview of the cell.contentView - performance was better, but still laggy.</p>
  
  <pre><code>UIImage *backImg = [[UIImage imageNamed:@"CellBackground"]  
                      resizableImageWithCapInsets:UIEdgeInsetsMake(16, 132, 16, 16)];
  UIImageView *imv = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
  imv.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
  imv.image = backImg;
  
  [self.contentView addSubview:imv];
  </code></pre>
  
  <p>Additionally, as mentioned above, my UITableViewCell is a subclass. The above code is in awakeFromNib, and I'm loading in my UITableViewCell like so:</p>
  
  <pre><code>// within initWithNibName: of UIViewcontroller:
  
  cellLoader = [UINib nibWithNibName:@"MasterTableViewCell" bundle:[NSBundle mainBundle]];
  
  // and UITableView method:
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {   
      MasterTableViewCell *cell = (MasterTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"MasterTableViewCell"];
      if (cell == nil) {
          NSArray *topLevelItems = [cellLoader instantiateWithOwner:self options:nil];
          cell = [topLevelItems objectAtIndex:0];
      }
      return cell;
  }
  </code></pre>
  
  <p>Am I doing something wrong? Any hints?</p>