2

I am on a quest to figure out how to decompress some NSData thats been compressed using Zlib. I have recently had some help here, I had added the second method into the my class where I need to use it but not the first as I do not need to compress the NSData only decompress.

However I am having trouble with these lines of code

z_stream strm;
strm.next_in = (Bytef *)[compressedData bytes];
strm.avail_in = (unsigned int)[compressedData length];
strm.total_out = 0;
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;

I do not know the object types of z-stream or strm I have tried declaring them in my header as NSStreams but that dose not do anything.

the errors I am getting are as follows

Use of undeclared identifier 'z_stream'

any help would be great appreciated.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
HurkNburkS
  • 5,492
  • 19
  • 100
  • 183

1 Answers1

3

It looks like you haven't included (imported) the header file that defines z_stream:

#import "zlib.h"
trojanfoe
  • 120,358
  • 21
  • 212
  • 242
  • oh man! thanks a bunch!! i have been googling the heck out of this you would have thought it would have known LOL Also I had zlib imported before i put the code in then took it out then inserted the code.. what an idiot. thank you very much for your answer I will mark it correct once time is up. – HurkNburkS Dec 12 '12 at 20:51