RE: Saving data to a file
RE: Saving data to a file
- Subject: RE: Saving data to a file
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Fri, 14 Mar 2003 17:19:35 -0500
You are talking about archiving, which deals with the NSCoder subclasses
NSArchiver, NSUnarchiver, NSKeyedArchiver and NSKeyedUnarchiver. Here is a
very good explanation of both "classic" and keyed archiving:
http://www.stepwise.com/Articles/VermontRecipes/KeyedArchiving.html
Just follow the example. You'll have to wrap your ints, BOOLs and other
scalars in objects like NSNumber or NSData, but other than that, it's pretty
straightforward.
Jonathan
>
-----Original Message-----
>
From: email@hidden
>
[mailto:email@hidden]On Behalf Of Ron Phillips
>
Sent: Friday, March 14, 2003 4:48 PM
>
To: email@hidden
>
Subject: Saving data to a file
>
>
>
I have scoured the cocoa-dev archives, web sites and books and still am
>
confused on how best to write data to a file from a non-document-based
>
application. An XML format is fine, human-readable is not required. I
>
have a collection of arrays, ints, strings, and BOOLs. What
>
preparation is needed for a property list? Chris Kane indicated that
>
archiving is not compatible with plists and writeToFile:atomically:.
>
That's cool, so do I just *somehow* wrap up my high-level object into
>
an NSData object and do the write? If so, what's the best approach to
>
do that? Is encoding still needed?
>
>
Thanks in advance and best regards,
>
Ron
>
_______________________________________________
>
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.
_______________________________________________
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.