In my setup I have an NSCollectionView of volumes connected to the mac. For the NSCollectionViewItem's View I have an NSBox with an NSTableView inside listing the contents of that volume.
My problem comes when trying to add/remove items to the NSTableView. The NSBox seems to be initialised once, so there is only one NSTableView. This means that when I want to update the data inside the NSTableView I cannot call reloadData on an IBOutlet and have it update all the tables.
If I create an IBOutlet in a subclass of the NSBox, it is nil for the instance, so I cannot call it via that.
The closest I have come is by enclosing a @try @catch around the code that returns the object at a row in a column, an exception occurs because that item no longer exists, so I can grab the tableView and call reloadData, which seems to update that specific NSTableView.
The problem with this is that if the item removed is at the end of the table, or if an item is added, the exception won't occur as it can see all the existing items.
Has anyone had any experience with an NSTableView on an NSCollectionViewItem's View? How did you update the tables?