I am creating a application to unzip zip files without prompting. I am using MAC OS 10.5 image in Vmaware.
I am new in cocoa programing. I searched few codes regarding this, but its not working..I am not getting any error or warning message.. Please kindly tell me its correct solution.. Zip file is not extracting and my application is closing after some time. I want to Unzip file without prompting and using any third party archive application.
I want to Unzip my file on the same location of its ZIP file.
Here is my code:
/* Assumes sourcePath and targetPath are both
valid, standardized paths. */
// Create the zip task
NSTask * backupTask = [[NSTask alloc] init];
[backupTask setLaunchPath:@"/usr/bin/ditto"];
[backupTask setArguments:
[NSArray arrayWithObjects:@"-c", @"-k", @"-X", @"--rsrc",
@"~/Desktop/demos.zip", @"~/Desktop", nil]];
// Launch it and wait for execution
[backupTask launch];
[backupTask waitUntilExit];
// Handle the task's termination status
if ([backupTask terminationStatus] != 0)
NSLog(@"Sorry, didn't work.");
// You *did* remember to wash behind your ears ...
// ... right?
[backupTask release];
-Thanks -with regards !