• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how do I save my NSOutlineView items into a file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >how do I save my NSOutlineView items into a file? (From: オウ ショビン <email@hidden>)
 >Re: how do I save my NSOutlineView items into a file? (From: email@hidden)

  • Prev by Date: Re: NSXMLParserErrorDomain 4
  • Next by Date: Making all a doc's windows come forward when one does
  • Previous by thread: Re: how do I save my NSOutlineView items into a file?
  • Next by thread: Displaying Only Readable/Writable Directory on NSOpenPanel
  • Index(es):
    • Date
    • Thread