Q:

Reusing constraints in tableviewcell and height is not updated

I have table view cell like this. 

After image is downloaded, I update the height of image view so that aspect ratio is correct (width is fixed).
[self.imgMain removeConstraint:self.aspectConstraint];
self.aspectConstraint = [NSLayoutConstraint constraintWithItem:self.imgMain
                                                     attribute:NSLayoutAttributeWidth
                                                     relatedBy:NSLayoutRelationEqual
                                                        toItem:self.imgMain
                                                     attribute:NSLayoutAttributeHeight
                                                    multiplier:aspectRatioMult
                                                      constant:0];
self.aspectConstraint.priority = 999;//the reason is that if it is 1000, it violate with my label height constraints and it broke label constraint.So I set to 999
[self.imgMain addConstraint:self.aspectConstraint];
[self setNeedsUpdateConstraints];
[self updateConstraints];

Problem is that although I update constraints, tableviewcell never change and it reuse cell in every 3 cell for the first time. If I scroll up and down, height is updated. How shall I update my constraints successfully? 
Edit
I set cell data like this.
- (void)setData:(NSDictionary *)dict
{
    if (!dict)
        return;

    self.cellData = [NSDictionary dictionaryWithDictionary:dict];
    [self.imgMain setImageWithURL:[NSURL URLWithString:self.cellData[SERVER_IMG]] placeholderImage:[UIImage new] completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL){

        if (image) {
            [self putImage:image];
            return ;
        }
        [self putImage:[UIImage imageNamed:@"placeholder.png"]];

    } usingActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];

    NSString *name = [NSString stringWithFormat:@"%@%@",SERVER_NAME, [LocalizationHelper getExtForLocale]];

    if([self.cellData[SERVER_INTEGRATION_ID]intValue]==SERVER_ISHOPCHANGI_ID) {

        [self.lblShopName setText:self.cellData[SERVER_DESCRIPTION]];
        [self.btnMap setHidden:YES];
        self.imgWidthMapBtnConstraint.constant = 0;
    } else {
        [self.lblShopName setText:self.cellData[SERVER_LOCATIONS][0][SERVER_SHOP]];
        [self.btnMap setHidden:[Helper isPointZero:dict[SERVER_LOCATIONS][0]]];
        self.imgWidthMapBtnConstraint.constant = 33;
    }
    [self.lblOfferTitle setText:self.cellData[name]];
}

A:

LITTLE OVERVIEW TO MAKE THINGS CLEAR:
While using Autolayout, for calculating the height of cell, iOS only calculates the height first time the cell is loaded for a indexPath and caches it, and reuse it next time, cell gets visible again.
TO resolve - >
Either Use,
tableView.beginUpdates()
tableView.endUpdates()

OR

tableView.reloadRowsAtIndexPath

REFERENCE LINKS

How to animate UITableViewCell height using auto-layout?

https://blog.pivotal.io/labs/labs/expandable-uitableviewcells

ANSWER TO YOUR QUESTION
You can use tableView.beginUpdates()/endUpdates() in set Data like
BELOW WON'T CAUSE INDEFINITE LOOP
-(void)setData{
  /*YOUR CODE UPDATING THE CONSTRAINTS*/
  tableView.beginUpdates()
  tableView.endUpdates()
}

OR
for using reloadRows CHECK if CONSTRAINTS are already SET, to break the loop, if yes, then don't call the reloadRows*
    -(void)setData{
       CGFloat requiredValue = 0;

if([self.cellData[SERVER_INTEGRATION_ID]intValue]==SERVER_ISHOPCHANGI_ID) {
       
requiredValue  = 0;

        } else {
    
       requiredValue  = 33;

      }
          /*CHECK IF CONSTRAINT ALREADY SET*/
         if(self.imgWidthMapBtnConstraint.constant != requiredValue){

          self.imgWidthMapBtnConstraint.constant = requiredValue;
           /**RELOAD ROW*/
        }
        }

