• 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
how do I save my NSOutlineView items into a file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how do I save my NSOutlineView items into a file?


  • Subject: how do I save my NSOutlineView items into a file?
  • From: オウ ショビン <email@hidden>
  • Date: Thu, 23 Feb 2006 16:37:52 +0900

I have written the following codes to save my NSOutlineView items. But when I debug the codes, it seems only the parentNode is saved but not including those children. I don't know why? I want to know whether "NSArchier" can used to save outlineView or not, though I found it can used to save the items of TableView.
And In general, how to save outlineView items.


Thanks for any help.
lepton
------------------------------------------------------------------------ --------------------------
- (IBAction)saveData:(id)sender
{
NSSavePanel *savePanel = [NSSavePanel savePanel];

[savePanel setTitle:@"Save NSOutlineView"];
[savePanel beginSheetForDirectory:NSHomeDirectory() file:nil modalForWindow:myWindow modalDelegate:self didEndSelector:@selector(didEndSaveSheet:returnCode:contextInfo:) contextInfo: NULL];
}


-(void) didEndSaveSheet:(NSSavePanel *)savePanel returnCode:(int) returnCode contextInfo:(void *)contextInfo
{


	if(returnCode == NSOKButton) {
	NSString *filename = [savePanel filename];

	[NSArchiver archiveRootObject:myOutlineItems toFile:filename];

//"myOutlineItems is NSMutableArray that includes all items in myOutlineView that is ture. 
Here for example: myOutlineView only include one column "


	[myOutlineView setAutosaveExpandedItems:YES];
	}
}

-(void)encodeWithCoder:(NSCoder *)encoder
{
	[encoder encodeObject:itemName];
}
_______________________________________________
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


  • Follow-Ups:
    • Re: how do I save my NSOutlineView items into a file?
      • From: email@hidden
  • Prev by Date: Re: How to build a popup menu and show this menu?
  • Next by Date: Re: How to build a popup menu and show this menu?
  • Previous by thread: Re: How to build a popup menu and show this menu?
  • Next by thread: Re: how do I save my NSOutlineView items into a file?
  • Index(es):
    • Date
    • Thread