After my method finishes, NSOutlineView calls outlineview:child:ofIndex: for reasons that are not clear to me.
It does not call outlineview:numberOfChildrenOfItem first.
Since I deleted an item from my data in the method, I get an error in outlineview:child:ofIndex: when the index exceeds the number of remaining children.
Any work-around would be an acceptable answer.
The outline view doesn't know when the data changes so you must keep the data and the outline view in sync. One way of doing this is inserting, moving and removing rows with:
Another way is reloading: