• 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: compressing an NSString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compressing an NSString


  • Subject: Re: compressing an NSString
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Sun, 14 May 2006 00:24:23 -0700


On May 13, 2006, at 12:06, John Stiles wrote:
Adam R. Maxwell wrote:
On May 13, 2006, at 10:10, Ondra Cada wrote:

Myself, I would launch bzip and pipe the data through it. YMMV, of course.


Anyroad, if you are about to write this, I guess you want rather compress NSData than NSStrings (adding perhaps just a convenience NSString category which would convert self to NSData and then use the compression).

OmniFoundation has an NSData category for compressing/ decompressing with gzip or bzip2. Seems to work quite well in my usage, but Ondra's solution probably requires the least code.


Shelling out to a separate process is a pretty heavyweight operation and will consume memory and time. Libbzip and libz are just simple, built-in dylibs which your app can trivially link to. I'm guessing that OmniFoundation's code is just an ObjC wrapper around these APIs.

(Personally, I'm familiar with the non-ObjC APIs; they are honestly very simple. It's only a couple of lines of code to compress or decompress data.)+

I'm not at all familiar with the non-ObjC API; since the app we use this with includes the Omni frameworks, though, we're using their implementation. It's quite a few lines of code, though, so it's apparently not the most simple solution.


Adam
_______________________________________________
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


References: 
 >Using CLI arguments in controller (scoping?) (From: Andrew Pouliot <email@hidden>)
 >compressing an NSString (From: stephen rouse <email@hidden>)
 >Re: compressing an NSString (From: Ondra Cada <email@hidden>)
 >Re: compressing an NSString (From: "Adam R. Maxwell" <email@hidden>)
 >Re: compressing an NSString (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Using NSImages as keys to a dictionary
  • Next by Date: Menu bar
  • Previous by thread: Re: compressing an NSString
  • Next by thread: Re: compressing an NSString
  • Index(es):
    • Date
    • Thread