No, there isn't a selectItem:
method, but there is an rowForItem:
method. If you combine that with Peter's advice about using selectRowIndexes:byExtendingSelection:
above, you should have all the information you need.
If you really wanted to have a method to select an item, which I would recommend calling setSelectedItem:
for consistency's sake, you could write something like this in a category on NSOutlineView
- (void)setSelectedItem:(id)item {
NSInteger itemIndex = [self rowForItem:item];
if (itemIndex < 0) {
// You need to decide what happens if the item doesn't exist
return;
}
[self selectRowIndexes:[NSIndexSet indexSetWithIndex:itemIndex] byExtendingSelection:NO];
}
I have no idea if this code actually works; I just dashed it off to illustrate the concept.