Re: how do I save my NSOutlineView items into a file?
Re: how do I save my NSOutlineView items into a file?
- Subject: Re: how do I save my NSOutlineView items into a file?
- From: xbwang <email@hidden>
- Date: Fri, 24 Feb 2006 13:45:54 +0900
Thank you for your advice.
I found it must do the step to save the children though they are the
same column in NSOutlineView. That is not as simple as NSTableView.
when I rewrite the code like the following, it looks work well.
Also, I corrected the codes in those required method Of NSOutlineView.
Now myOutlineview can reload the items from the saved file correctly.
-(void)encodeWithCoder:(NSCoder *)encoder
{
[encoder encodeObject:itemName];
[encoder encodeObject:children];
return;
}
by the way, NSKeyedArchiver is also works well
Thanks a lot.
lepton
-(void)encodeWithCoder:(NSCoder *)encoder
{
[encoder encodeObject:itemName];
}
Here, are each itemName object compliant for NSCoding? You should
use encodeObject: forKey: in combination with NSKeyedArchiver.
You also need to call [super encodeWithCoder:coder]; before
anything else in your object.
Have you read: http://developer.apple.com/documentation/Cocoa/
Conceptual/Archiving/index.html ?
Andre
email@hidden
_______________________________________________
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