title: Using Xcode and Interface Builder to create prototype views
body: <p>I'm building an NSView that is a kind of collection view, but instead of a table or a grid it will be a graph editor (similar to quartz composer).</p>
  
  <p>The problem I'm facing now is that I would like to load prototype views (for the nodes) from a <code>xib</code> file. Much like how UITableView and UICollectionView lets you design prototype cells in Interface Builder. But how are these objects then instantiated in multiple copies?</p>
  
  <p>How does UITableViewController et. al. achieve this?</p>
  
  <p>Solutions I have thought about:</p>
  
  <ul>
  <li>Copy the view, but <code>NSView</code> does not support <code>NSCopying</code> "out of the box". This seems like the most logical so far. It also seems like the only option if you want to keep the NSView in a <code>storyboard</code> rather than a <code>xib</code>.</li>
  <li>Load a nib and then send <code>[nib instantiateNibWithOwner:self topLevelObjects:nil]</code> multiple times.</li>
  <li><code>NSView</code> does support <code>NSCoding</code> but using that feels more like a hack.</li>
  </ul>
  
  <p>Any more ideas?</p>
  
  <p>I'm developing an Mac OS X app, not an iOS app.</p>