I have just encountered a problem when using NSOutlineView and wonder is anyone has a solution.
I have a hierarchy of items and the lowest nodes are objects that can appear in more than one location.
For example:
Country
Town
- Car Manufacturer
USA
Chicago
- Toyota
Dallas
- Toyota
Now if the user selects the 'Toyota' items in the list and if I then try and find the parent for the selected item using the outlineView.parent(forItem:) API it will always return the same parent item, presumably the first one it encounters.
It seems that outlineView does not independently keep track of the parent item when loading data from the data source.
Presumably the only way to overcome this would be to create some sort of unique wrapper object, a struct maybe, at each node to hold the common object.
Anyone have any idea what methods NSOutlineView uses to find the parent of a given object?