Re: Saving NSTableView data
Re: Saving NSTableView data
- Subject: Re: Saving NSTableView data
- From: Sherm Pendley <email@hidden>
- Date: Fri, 28 Jun 2002 01:57:08 -0400
On Thursday, June 27, 2002, at 03:00 PM, Aidas wrote:
I have a NSTableView. It has multiple collumns. How could I save it's
data
into file and later read it?
I'm assuming that what you really want to do is save the data from the
NSTableView's data source, which should be an object that implements the
NSTableDataSource protocol.
I'm also assuming that the data source is implemented internally as an
NSArray of rows, with each row containing an NSDictionary of named
columns. Or perhaps it's vice-versa, and your columns collection is
topmost, with each column containing an array of rows.
Either way, whether the top-level collection object is an NSArray or an
NSDictionary, you can use its writeToFile:atomically: method to store
its contents to a file in property list (plist) format, and
initWithContentsOfFile: method to recreate it.
sherm--
Never put off until tomorrow what you can do today. There might be a law
against it by that time.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.