title: Adding a view to UIScrollview
body: <p>I have created a <code>UIView</code></p>
  
  <pre><code>- (id)initWithFrame:(CGRect)frame
  {
      self = [super initWithFrame:frame];
      if (self) {
          // Initialization code
  
          UIImage *image2 = [UIImage imageNamed:@"pinGreen_v1.png"];
          UIImage *image1 = [UIImage imageNamed:@"PinDown1.png"];
  
          UIButton *btn1 = [[UIButton alloc]initWithFrame:CGRectMake(0, 10, 40, 40)];
          [btn1 setImage:image2 forState:UIControlStateNormal];
          [self addSubview:btn1]; 
  
          for(int i =1; i&lt;20; i++){
              UIButton *btn2 = [[UIButton alloc]initWithFrame:CGRectMake(40 * i, 40, 40, 40)];
              [btn2 setImage:image1 forState:UIControlStateNormal];
              [btn2 addTarget:self 
                       action:@selector(buttonPressed) 
             forControlEvents:UIControlEventTouchUpInside];
              [self addSubview:btn2];
          }
  
      }
      return self;
  }
  </code></pre>
  
  <p>With the above code I am drawing images in my view. I am loading this view from my view controller. I need to put this view inside a <code>UIScrollview</code>. Where should I create the scroll view? In the above view or the view controller where the above view is created.</p>
  
  <p>The code inside my view controller is :</p>
  
  <pre><code> DrawLineInMyClass *drawLines = [[DrawLineInMyClass alloc]initWithFrame:CGRectMake(0, 0, 320, 400)];
   drawLines.backgroundColor = [UIColor blackColor];
   [self.view addSubview:drawLines];
   [drawLines release];
  </code></pre>
  
  <p>I should be able to scroll through the images inside my view.</p>