(Objective-C) Transition from Zip.GetEntryByIndex to Zip.EntryAt
Provides instructions for replacing deprecated GetEntryByIndex method calls with EntryAt. Note: This example requires Chilkat v11.0.0 or greater.
#import <CkoZip.h>
#import <CkoZipEntry.h>
CkoZip *zip = [[CkoZip alloc] init];
// ...
// ...
int index = 15;
// ------------------------------------------------------------------------
// The GetEntryByIndex method is deprecated:
CkoZipEntry *entryObj = [zip GetEntryByIndex: [NSNumber numberWithInt: index]];
if (zip.LastMethodSuccess == NO) {
NSLog(@"%@",zip.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using EntryAt.
// Your application creates a new, empty ZipEntry object which is passed
// in the last argument and filled upon success.
CkoZipEntry *ze = [[CkoZipEntry alloc] init];
BOOL success = [zip EntryAt: [NSNumber numberWithInt: index] entry: ze];
if (success == NO) {
NSLog(@"%@",zip.LastErrorText);
return;
}
|