title: How to add images in nested UIScrollview
body: <p>I need to add images in scroll view multiple times. Am created a scrollview but images not append correctly in that. </p>
  
  <p>My code is here : </p>
  
  <pre><code>-(void)sampleScroll
  {
      int x = 10;
      int y = 20;
  
      mainScrollView = [[UIScrollView alloc] initWithFrame:self.view.frame];
      mainScrollView.contentSize = CGSizeMake(50, (y + 95) * 5);
  
      // further configure
     [self.view addSubview: mainScrollView];
      images = [[NSMutableArray alloc] initWithObjects:@"image0.jpg",@"image1.jpg",@"image2.jpg",@"image3.jpg", nil];
  
  
      for(int i=0; i&lt;[images count]; i++)
      {
          NSLog(@"%@",images);
          UIScrollView *scrollview=[[UIScrollView alloc]initWithFrame:CGRectMake(x, y, 250, 150)];
          scrollview.showsVerticalScrollIndicator=YES;
          scrollview.scrollEnabled=YES;
          scrollview.userInteractionEnabled=YES;
          scrollview.backgroundColor = [UIColor whiteColor];
          NSString *img = [images objectAtIndex:i];
           NSLog(@"%@",img);
          imageView.image = [UIImage imageNamed:@"image3.jpg"];
          NSLog(@"%@",imageView.image);
          scrollview.contentSize = CGSizeMake(1250,250);
          [scrollview addSubview:imageView];
          [mainScrollView addSubview:scrollview];
          y=y+155;
          //[self myscrollView];
      }
  }
  </code></pre>
  
  <p>Please give me a solution. Thanks in advance..</p>