title: NSScrollView infinite / endless scroll | subview reuse
body: <p>I'm searching for a way to implement something like reusable cells for <code>UI/NSTableView</code> but for <code>NSScrollView</code>. Basically I want the same like the WWDC 2011 video "Session 104 - Advanced Scroll View Techniques" but for Mac.</p>
  
  <p>I have several problems realizing this. The first: <code>NSScrollView</code> doesn't have <code>-layoutSubviews</code>. I tried to use <code>-adjustScroll</code> instead but fail in setting a different <code>contentOffset</code>:</p>
  
  <pre><code>- (NSRect)adjustScroll:(NSRect)proposedVisibleRect {
      if (proposedVisibleRect.origin.x &gt; 600) {
          //  non of them work properly
          // proposedVisibleRect.origin.x = 0;
          // [self setBoundsOrigin:NSZeroPoint];
          // [self setFrameOrigin:NSZeroPoint];
          // [[parentScrollView contentView] scrollPoint:NSZeroPoint];
          // [[parentScrollView contentView] setBoundsOrigin:NSZeroPoint];
      }
      return proposedVisibleRect;
  }
  </code></pre>
  
  <p>The next thing I tried was to set a really huge content view with a <code>width</code> of millions of pixel (which actually works in comparison to iOS!) but now the question is, how to install a reuse-pool?<br>
  Is it better to move the subviews while scrolling to a new position or to remove all subviews and insert them again? and how and where should I do that?</p>