Archived Forum Post

Index of archived forum posts

Question:

Error when using AppendZip

Jul 23 '15 at 03:28

I have written the following Objective-C code to append two zip files:

CkoZip* raw = [[CkoZip alloc] init];
[raw UnlockComponent:@"Hello, world!"];

NSString* rawDir = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"raw"];
NSString* patchDir = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"zip"];
[raw OpenZip:rawDir];
[raw AppendZip:patchDir];

But in the last line, I encounter this runtime error:

ZipTest(10504,0x10c51a300) malloc: *** error for object 0x7fe251c26310: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

What is the problem? Am I using AppendZip wrong?