title: Why does my survey app make memory leak? (Multiple UIViews and UITextViews in one UIScrollView)
body: <p>I am trying to make a survey app but I can't make the memory management although I am using ARC. My app makes memory leak. I get memory warning. When I make my app in interface builder statically there is no problem but when i make my app programmatically I get memory problem. Why is that happening? Here is my code:</p>
  
  <pre><code>#import "ViewController.h"
  #import &lt;QuartzCore/QuartzCore.h&gt;
  int soruAdedi = 20;
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  @synthesize scrollView2;
  -(void)textViewBicimle: (UITextField *)textAlani{
      [textAlani.layer setBorderColor:[[[UIColor blackColor] colorWithAlphaComponent:1.0] CGColor]];
      [textAlani.layer setBorderWidth:1.0];
  }
  
  - (void) tableCiz:(NSMutableArray *)hucreler sutun:(int)sutunSayisi satir:(int)satirSayisi{
      int z = 0;
      for (int i =0;i&lt;satirSayisi;i++){
          for(int j=0;j&lt;sutunSayisi&amp;&amp;z&lt;satirSayisi*sutunSayisi;j++,z++){
              [self textViewBicimle:[hucreler objectAtIndex:z]];
              [[hucreler objectAtIndex:z] setFrame:CGRectMake((20+j*100), (20+i*40), 100, 40)];
          }
      }
  }
  
  -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
  
  }
  
  -(void)hucreArrayOlustur: (int)sutunSayisi suankiView:(UIView *)soruViewIki satir:(int)satirSayisi{
      for (int i = 0; i &lt;sutunSayisi*satirSayisi; i++){
          textView = [[UITextField alloc]init];
          textView.text = @"dsgfdh";
          [hucreArray addObject:textView];
          [soruViewIki addSubview:textView];
      }
  }
  
  -(void)viewOlustur{
      for (int i = 0; i &lt;soruAdedi; i++){
          hucreArray = [[NSMutableArray alloc]init];
          if (i == 0){
              soruView = [[UIView alloc]initWithFrame:CGRectMake(20, 20, 728, 0)];
              soruView.clipsToBounds = YES;
              soruView.backgroundColor = [UIColor lightGrayColor];
              [self hucreArrayOlustur:5 suankiView:soruView satir:10];
              [self tableCiz:hucreArray sutun:5 satir:10];
              CGRect frame = soruView.frame;
              CGRect frame2 = [[hucreArray objectAtIndex:49] frame];
              frame.size.height =  frame2.origin.y+frame2.size.height+34;
              soruView.frame = frame;
              [viewArray addObject:soruView];
              [scrollView2 addSubview:soruView];
          }
          else{
              CGRect frameGecici = [[viewArray objectAtIndex:i-1] frame];
              float geciciY = frameGecici.origin.y+frameGecici.size.height+1;
              soruView = [[UIView alloc]initWithFrame:CGRectMake(20, geciciY, 728, 0)];
              soruView.clipsToBounds = YES;
              soruView.backgroundColor = [UIColor lightGrayColor];
              [self hucreArrayOlustur:5 suankiView:soruView satir:10];
              [self tableCiz:hucreArray sutun:5 satir:10];
              CGRect frame = soruView.frame;
              CGRect frame2 = [[hucreArray objectAtIndex:49] frame];
              frame.size.height =  frame2.origin.y+frame2.size.height+34;
              soruView.frame = frame;
              [viewArray addObject:soruView];
              [scrollView2 addSubview:soruView];
          }
      }
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      scrollView2.delegate = self;
      scrollView2.contentSize = CGSizeMake(0, 8000);
      viewArray = [[NSMutableArray alloc]init];
      [self viewOlustur];
      // Do any additional setup after loading the view, typically from a nib.
  }
  
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  - (void)viewDidUnload {
      [self setScrollView2:nil];
      [super viewDidUnload];
  }
  @end
  </code></pre>