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: "Kirt Cathey" <email@hidden>
- Date: Tue, 29 Mar 2005 03:18:18 +0000
Here's the web site... forgot it in the previous posting.
http://www.macocoa.omitech.it/capitoli/mc017.htm
From the desk of ..........
Barking Frog
email: email@hidden
From: Shawn Erickson <email@hidden>
To: "Kirt Cathey" <email@hidden>
CC: email@hidden
Subject: Re: Saving State of NSOutlineView in Document-based App
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
_________________________________________________________________
楽しい絵文字でココロ伝わるメッセンジャー http://messenger.msn.co.jp/
_______________________________________________
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