Reputation: 1301
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.
Upvotes: 1
Views: 768
Reputation: 90561
This should do it:
for (NSInteger i = 0; i < outlineView.numberOfRows; i++)
{
if ([outlineView levelForRow:i] < depthLimit)
[outlineView expandItem:[outlineView itemAtRow:i]];
}
Upvotes: 2