Expanding all rows of an outline view
Expanding all rows of an outline view
- Subject: Expanding all rows of an outline view
- From: Andrew Merenbach <email@hidden>
- Date: Tue, 19 Jun 2007 16:59:12 -0700
Hi, all. I have some code to expand the items in an NSOutlineView
(bound to an NSTreeController) which acts as a log:
- (void)expandAllRows:(id)sender {
unsigned int rows = [self numberOfRows];
id item;
int i;
for (i = rows - 1; i >= 0; --i) {
item = [self itemAtRow:i];
if ([self isExpandable:item]) {
[self expandItem:item];
}
}
}
The code works perfectly when I connect it to a button in a toolbar.
Every item expands and shows its children.
At the end of my logging code, however, if I want to expand the
newest addition there, it doesn't expand with the above code--all the
other items, however, expand. In fact, checking the number of rows,
it's as though the first row is completely ignored--I get one fewer
than the number of rows that I see!
Is there some caveat with adding to an NSTreeController in that it
perhaps takes a certain amount of time to update bound objects, and
such that I have to wait before I can count a new row in the total
list of rows?
Thanks,
Andrew
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden