How can I, on setup, expand all items of an NSOutlineVIew to a determined level? After this the user it's free to expando or collapse all the nodes of the tree.
The data comes from a NSTreeController bound to the view.
This should do it:
for (NSInteger i = 0; i < outlineView.numberOfRows; i++)
{
if ([outlineView levelForRow:i] < depthLimit)
[outlineView expandItem:[outlineView itemAtRow:i]];
}