title: How to remove a subview which is a UILabel
body: <p>I have a scroll view, in which I am adding multiple UIImageview's.</p>
  
  <p>For each image view I am adding a UIButton and a UILabel.</p>
  
  <p>Now i want to remove UILabel view.</p>
  
  <p>Please find with my code below</p>
  
  <pre><code> - (void)viewDidLoad {
      [super viewDidLoad];
  
      int h;
      for (h=0; h&lt;3; h++) {
      UIImageView *k=[[UIImageView alloc]initWithFrame:CGRectMake(h*40, 0, 60, 90)];
      k.backgroundColor=[UIColor yellowColor];
      k.tag=h;
  
      UIButton *j=[[UIButton alloc]initWithFrame:CGRectMake(20, 20, 20, 20)];
      [j addTarget:self action:@selector(ge:) forControlEvents: UIControlEventTouchUpInside];
      j.backgroundColor=[UIColor redColor];
      [k addSubview:j];
      k.userInteractionEnabled=YES;
      [self.view addSubview:k];
  
      }
  
  }
  </code></pre>
  
  <p>Here I am just adding an image view and a button. If label exists remove UILabel else add UILabel</p>
  
  <p>Once user click on the button </p>
  
  <pre><code>-(IBAction)ge:(id)sender{
  
  
      UIImageView *imageView = (UIImageView *)[sender superview];
      for (UIView *jkl in [[sender superview]subviews]) {
          if ([jkl isKindOfClass:[UILabel class]]){ 
              [jkl removeFromSuperview];
  
  
          } else {
              UILabel *y=[[UILabel alloc]initWithFrame:CGRectMake(20, 20, 20, 20)];
  
              y.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"Close.jpeg"]];
              [imageView addSubview:y];
          }
  
      }
  
  }
  </code></pre>
  
  <p>but UILabel is not getting removed. Can you please help.</p>