Re: Saving State of NSOutlineView in Document-based App
Re: Saving State of NSOutlineView in Document-based App
- Subject: Re: Saving State of NSOutlineView in Document-based App
- From: Shawn Erickson <email@hidden>
- Date: Mon, 28 Mar 2005 09:25:58 -0800
On Mar 26, 2005, at 5:11 PM, Kirt Cathey wrote:
After reviewing another posting in this archive, I added the following
in the init portion of the data source.
[outline setAutosaveName:@"Subscriptions Outline"];
[outline setDataSource:dataSource];
[outline setDelegate:dataSource];
[outline setAutosaveExpandedItems:YES];
Then in the data source also added the following methods:
- (id)outlineView:(NSOutlineView *)outlineView
persistentObjectForItem:(id)item
{
return [NSKeyedArchiver archivedDataWithRootObject:item];
}
- (id)outlineView:(NSOutlineView *)outlineView
itemForPersistentObject:(id)object
{
return [NSKeyedUnarchiver unarchiveObjectWithData:object];
}
All of which is verbatim off of the existing archives. Upon debugging,
the first set of statements included in the data source init section
are called, but the associated methods are not called at all.
When you see these called is the "outline" outlet actually valid (not
nil)?
If your data source is an object instantiated in your nib then you
cannot do the calls against the outlet at init time but have to do it
at awakeFromNib time.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden