Objective-C
Objective-C
Transition from Zip.GetEntryByName to Zip.EntryOf
Provides instructions for replacing deprecated GetEntryByName method calls with EntryOf.Chilkat Objective-C Downloads
#import <CkoZip.h>
#import <NSString.h>
#import <CkoZipEntry.h>
BOOL success = NO;
CkoZip *zip = [[CkoZip alloc] init];
// ...
// ...
NSString *pathInZip = @"example.txt";
// ------------------------------------------------------------------------
// The GetEntryByName method is deprecated:
CkoZipEntry *entryObj = [zip GetEntryByName: pathInZip];
if (zip.LastMethodSuccess == NO) {
NSLog(@"%@",zip.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using EntryOf.
// Your application creates a new, empty ZipEntry object which is passed
// in the last argument and filled upon success.
CkoZipEntry *ze = [[CkoZipEntry alloc] init];
success = [zip EntryOf: pathInZip entry: ze];
if (success == NO) {
NSLog(@"%@",zip.LastErrorText);
return;
}