[NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)
[NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)
- Subject: [NSOutlineView] Saving/Restoring the hierarchy disclosure state (Reloaded)
- From: Stéphane Sudre <email@hidden>
- Date: Thu, 26 Jun 2008 00:46:27 +0200
I'm beginning to wonder if it's possible to save and restore the
current disclosure state of the hierarchy of a NSOutlineView.
- Iterating the hierarchy does not save the state of hidden children.
- the persistentObject API is not useful in my case as I have
multiple instances of the same NSOutlineView through multiple
documents and I don't need/want to keep this piece of information in
the defaults.
- When asked about this, the NSOutlineView oracle suggested to use
the notification methods:
- (void)outlineViewItemWillExpand:(NSNotification *)notification;
- (void)outlineViewItemDidExpand:(NSNotification *)notification;
- (void)outlineViewItemWillCollapse:(NSNotification *)notification;
- (void)outlineViewItemDidCollapse:(NSNotification *)notification;
Unfortunately, this does not work as when you close a branch,
every child of this branch receives the willCollapse and didCollapse
notifications (Mac OS X 10.4.11).
Looking for other suggestions (if any left).
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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