Re: NSData from NSArchiver and plist Utility
Re: NSData from NSArchiver and plist Utility
- Subject: Re: NSData from NSArchiver and plist Utility
- From: Jens Alfke <email@hidden>
- Date: Wed, 11 Jun 2008 12:44:52 -0700
On 11 Jun '08, at 9:35 AM, Trygve Inda wrote:
I have a plist that I will store on a server and my app will
retrieve it.
I'd like to archive one of the keys (an array) into an NSData and
possibly
compress it.... Makes for less storage and thus lower bandwidth for my
server.
Why not just compress the entire plist? In my experience, zlib
compresses markup data like XML by about 10::1.
myData = [NSArchiver archivedDataWithRootObject:(NSArray*)myArray];
There's not much reason to use NSArchiver on plist-compatible data
(arrays, strings, etc.) An XML archive will just be a much more
verbose plist, and a binary archive will be identical to what you'd
get if you used NSPropertyListSerialization to save a binary plist.
(Binary plists are already quite a bit smaller than XML ones, and
conveniently unreadable by eye, so you might just try that.)
—Jens
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden