title: How to increase the content view of NSScrollView horizontally?
body: <p>I am using NSScrollView of size 440x44 , i am creating check buttons dynamically and want to add them in scroll view horizontally not vertically , i have initially added 10 buttons in the scroll view like this</p>
  
  <pre><code>self.scrollView.hasVerticalScroller=NO;
  self.scrollView.hasHorizontalScroller=YES;
  int counter =0; 
  for(int i=0;i&lt;10;i++)
  {
      NSRect frame;
      frame.size.width = frame.size.height = 50;
      if(i&gt;0)
          frame.origin.x=counter;
      NSButton *myCheckBox2 = [[NSButton alloc] initWithFrame:frame];
      [myCheckBox2 setButtonType:NSSwitchButton];
      [myCheckBox2 setTitle:@"Hello"];
      [myCheckBox2 setBezelStyle:2];
      [self.scrollView.documentView addSubview:myCheckBox2];
      //[self.scrollView setDocumentView:myCheckBox2];
      [self.scrollView addSubview:myCheckBox2];
      counter=counter+50;
    //  [self.scrollView setHorizontalLineScroll:1000];
  }
  </code></pre>
  
  <p>When i run the code i achieved this
  <a href="https://i.stack.imgur.com/6goGN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6goGN.png" alt="enter image description here"></a></p>
  
  <p>But the problem is i am unable to scroll it horizontally....... How can i achieve this?</p>