newbee with this lib and ios5

Skip to first unread message


Jan 23, 2012, 7:02:27 AM1/23/12
to ASIHTTPRequest
Hi, i downloaded the library and then fixing some errors with
automatic counter (ARC) i still get this strange error:

error: implicit conversion of 'BOOL' (aka 'signed char') to 'NSData *'
is disallowed with ARC [4]
return NO;

this is the method when it crashes:

- (NSData *)compressBytes:(Bytef *)bytes length:(NSUInteger)length
error:(NSError **)err shouldFinish:(BOOL)shouldFinish
if (length == 0) return nil;

NSUInteger halfLength = length/2;

// We'll take a guess that the compressed data will fit in half the
size of the original (ie the max to compress at once is half
DATA_CHUNK_SIZE), if not, we'll increase it below
NSMutableData *outputData = [NSMutableData dataWithLength:length/2];

int status;

zStream.next_in = bytes;
zStream.avail_in = (unsigned int)length;
zStream.avail_out = 0;

NSInteger bytesProcessedAlready = zStream.total_out;
while (zStream.avail_out == 0) {

if (zStream.total_out-bytesProcessedAlready >= [outputData length])
[outputData increaseLengthBy:halfLength];

zStream.next_out = (Bytef*)[outputData mutableBytes] +
zStream.avail_out = (unsigned int)([outputData length] -
status = deflate(&zStream, shouldFinish ? Z_FINISH : Z_NO_FLUSH);

if (status == Z_STREAM_END) {
} else if (status != Z_OK) {
if (err) {
*err = [[self class] deflateErrorWithCode:status];
return NO; //this is the line when crash the build

// Set real length
[outputData setLength: zStream.total_out-bytesProcessedAlready];
return outputData;

Im using xcode 4.2

Vítor Ferreira

Jan 27, 2012, 8:07:20 AM1/27/12
to ASIHTTPRequest

We just make return nil;

Best regards
Vitor Ferreira

Alonso Isidoro Roman

Jan 31, 2012, 5:16:14 AM1/31/12
Hi Vitor, so you are using this lib on your project? is it secure, does it works?

2012/1/27 Vítor Ferreira <>
You received this message because you are subscribed to the Google Groups "ASIHTTPRequest" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

Alonso Isidoro Roman.

Mis citas preferidas (de hoy) :
"Si depurar es el proceso de quitar los errores de software, entonces programar debe ser el proceso de introducirlos..."
 -  Edsger Dijkstra

Vitor Ferreira

Jan 31, 2012, 5:46:43 AM1/31/12
Yes!, it works fine :)


Alonso Isidoro Roman

Jan 31, 2012, 5:54:09 AM1/31/12
Could you send me the correct download link?

thanx in advance! 

2012/1/31 Vitor Ferreira <>
Reply all
Reply to author
0 new messages