• 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: NSData from NSArchiver and plist Utility
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSData from NSArchiver and plist Utility
      • From: Trygve Inda <email@hidden>
References: 
 >NSData from NSArchiver and plist Utility (From: Trygve Inda <email@hidden>)

  • Prev by Date: Loading a nib
  • Next by Date: Re: Documenting projects
  • Previous by thread: Re: NSData from NSArchiver and plist Utility
  • Next by thread: Re: NSData from NSArchiver and plist Utility
  • Index(es):
    • Date
    • Thread