title: How to update Label Programmatically in iOS?
body: <p>I am facing a problem with updating my labels. It doesn't remove the old names so new names go on top of old ones. any help with this will be appreciated..</p>
  
  <pre><code>    NSDictionary *arrDictionary = [NSJSONSerialization JSONObjectWithData:requestHandler options:0 error:nil];
  
      NSDictionary *vendorDic = [arrDictionary objectForKey:@"feed"];
      NSLog(@" the response is %@",vendorDic);
       NSArray * titleArray  = [vendorDic valueForKey:@"title"];
      NSArray * reviewArray = [vendorDic valueForKey:@"review"];
      if (titleArray.count == 0) {
           self.scrollViewReview.contentSize = CGSizeMake(0*172, _scrollViewReview.frame.size.height);
      }
      else{
          NSUInteger x =[titleArray count];
  
          self.scrollViewReview.contentSize = CGSizeMake(x*172, _scrollViewReview.frame.size.height);
      for(int i = 0;i &lt;= titleArray.count-1;i = i + 1){
          _noReview.hidden = YES;
          UILabel * titleLabel =  [[UILabel alloc] initWithFrame: CGRectMake(i*172, 0, 100, 50)];
          UILabel * reviewLabel = [[UILabel alloc] initWithFrame:CGRectMake(i * 172 , 30, 200, 50)];
          titleLabel.clearsContextBeforeDrawing =YES;
          titleLabel.clipsToBounds = YES;
          reviewLabel.clipsToBounds = YES;
          reviewLabel.clearsContextBeforeDrawing=YES;
          NSString* titleStr = [NSString stringWithFormat:@"%@", titleArray[i]];
          NSString * reviewStr =[NSString stringWithFormat:@"%@",reviewArray[i]];
         // NSLog(@" loop in for  title: %@",titleStr);
         //NSLog(@" loop in for  title: %@",reviewStr);
          titleLabel.text = titleStr;
          titleLabel.textColor = [UIColor greenColor];
          titleLabel.font =[UIFont fontWithName:@"Arial-BoldMT" size:16.0];
          reviewLabel.font = [UIFont systemFontOfSize:12];
          reviewLabel.text = reviewStr;//etc...
          [self.viewReview addSubview:titleLabel];
          [self.viewReview addSubview:reviewLabel];
  
      }
      }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/KcJSu.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KcJSu.jpg" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>Labels are doesn't remove the old names so new names go on top of old
    ones like this...</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/sidDZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sidDZ.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>Note : titleLabel is "Nice Product" And reviewLabel is "This is
    Amazing"</p>
  </blockquote>