title: UITableView row height not changing
body: <p>I have created a custom Cell. I have an array of dictionaries. For the dictionary values I need to create <code>UILable</code>s. Each cell may contained different number of <code>UILabel</code>s. So in my custom <code>UITableViewCell</code> class I have done like this.</p>
  
  <pre><code>- (void)generateCell {
  
  
  BOOL isLandscape = UIInterfaceOrientationIsLandscape(vc.interfaceOrientation);
  for (int i = 0; i &lt; [orderMap count]; i++) {
      UILabel *lbl = [[UILabel alloc] init];
      [lbl setTextColor:[UIColor blueColor]];
      [lbl setBackgroundColor:[UIColor yellowColor]];
      lbl.tag = [[orderMap objectAtIndex:i] intValue];
      [lbl setNumberOfLines:0];
      [self.contentView addSubview:lbl];
      [lbl setTranslatesAutoresizingMaskIntoConstraints:false];
  
  }
  
  if (isLandscape) {
  
  }
  else {
      [self setConstraintsForPortrait];
  }
  }
  
  - (void)setConstraintsForPortrait {
  
  
  double currentUsedWidth = 0;
  double relativeWidthLimit = 1;
  int reservedPaddingSpace = 20;
  int usableScreenWidthPts = 0;
  int xPositionStartingPoint = 15;
  int xPosition = xPositionStartingPoint;
  int yPosition = INDIVIDUAL_PADDING_PTS;
  int fieldCounter = 0;
  UIView *previousView;
  
  for (UIView *vw in [self.contentView subviews]) {
      NSLayoutConstraint *leading = [NSLayoutConstraint constraintWithItem:vw attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeLeading multiplier:1.0 constant:(xPosition + INDIVIDUAL_PADDING_PTS)];
      NSLayoutConstraint *top;
  
      if (previousView == nil) {
          top = [NSLayoutConstraint constraintWithItem:vw attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:INDIVIDUAL_PADDING_PTS];
      }
      else {
          top = [NSLayoutConstraint constraintWithItem:vw attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:previousView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:INDIVIDUAL_PADDING_PTS];
      }
  
      NSLayoutConstraint *trailing = [NSLayoutConstraint constraintWithItem:vw attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeTrailing multiplier:1.0 constant:INDIVIDUAL_PADDING_PTS];
      if (fieldCounter &gt;= [orderMap count]) {
          NSLayoutConstraint *bottom = [NSLayoutConstraint constraintWithItem:vw attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:INDIVIDUAL_PADDING_PTS];
  
          [self.contentView addConstraint:bottom];
      }
  
  
  
      [self.contentView addConstraint:leading];
      [self.contentView addConstraint:top];
      [self.contentView addConstraint:trailing];
      previousView = vw;
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And in my <code>UIViewController</code> <code>viewDidLoad</code> method I have done this.</p>
  
  <pre><code>UINib *nib = [UINib nibWithNibName:@"TableViewCell" bundle:[NSBundle mainBundle]];
  [self.tbl registerNib:nib forCellReuseIdentifier:metadataListTableIdentifier];
  self.tbl.estimatedRowHeight = 200;
  self.tbl.rowHeight = UITableViewAutomaticDimension;
  [self.tbl reloadData];
  </code></pre>
  
  <p>Why the cell height is not changing? Please help me.
  Thanks</p>