Re: Saving state of outlineView AND Expanding all items SOLVED
Re: Saving state of outlineView AND Expanding all items SOLVED
- Subject: Re: Saving state of outlineView AND Expanding all items SOLVED
- From: Jan Van Tol <email@hidden>
- Date: Tue, 11 Feb 2003 14:38:49 -0600
Okay, I figured out how to get the PersistentObject stuff to work for
me.
When I'm creating my dataSource object:
[outline setAutosaveName:@"Subscriptions Outline"];
[outline setDataSource:dataSource];
[outline setDelegate:dataSource];
[outline setAutosaveExpandedItems:YES];
In the data source:
- (id)outlineView:(NSOutlineView *)outlineView
persistentObjectForItem:(id)item {
//return a string representing item
}
- (id)outlineView:(NSOutlineView *)outlineView
itemForPersistentObject:(id)object {
//return the item represented by object, the string returned earlier
}
And it's that simple.
-Jan Van Tol
On Monday, February 10, 2003, at 11:14 PM, Jan Van Tol wrote:
Hello list,
Can someone suggest a good method to save the expanded state of
outline view items? Well, actually that part is easy - the hard part
is when to tell them to expand. I've checked the archives, and it
appears there are issues with expanding the proper items in
willDisplayCell, so thats out. I can't use the
itemForPersistentObject stuff. This would be easy if there was some
sort of OutlineViewDidFinishLoadingDataNotification or something.
Could I perhaps bend itemForPersistentObject to my ways somehow? Say
I have a dictionary. The keys are strings representing an outlineView
item, the values are true or false. If the outlineView could check
that dictionary, and expand items based on what it finds there it
would be ideal.
Oh, and failing that, I would like to be able to make an outline
expand all it's items when it loads them.
Thanks in advance!
-Jan Van Tol
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.