I am creating an NSView, which is a kind of collection view, but instead of a table or grid, it will be a graph editor (similar to a quartz composer).
The problem I am facing right now is that I would like to load the prototype views (for nodes) from the xib file. Like UITableView and UICollectionView, you can prototype cells in Interface Builder. But how are these objects then created in multiple instances?
How does UITableViewController et al. Achieve this?
The solutions I thought of:
- Copy the view, but
NSView does not support NSCopying out of the box. This seems the most logical so far. This also seems like the only option if you want to save the NSView in the storyboard , not in xib . - Download the tip, and then send
[nib instantiateNibWithOwner:self topLevelObjects:nil] several times. NSView supports NSCoding , but using this is more like a hack.
Any ideas?
I am developing a Mac OS X application, not an iOS application.
source share