(Objective-C) Transition from Zip.GetEntryByID to Zip.EntryById
Provides instructions for replacing deprecated GetEntryByID method calls with EntryById. Note: This example requires Chilkat v11.0.0 or greater.
#import <CkoZip.h>
#import <CkoZipEntry.h>
CkoZip *zip = [[CkoZip alloc] init];
// ...
// ...
int id = 123;
// ------------------------------------------------------------------------
// The GetEntryByID method is deprecated:
CkoZipEntry *entryObj = [zip GetEntryByID: [NSNumber numberWithInt: id]];
if (zip.LastMethodSuccess == NO) {
NSLog(@"%@",zip.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using EntryById.
// 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 EntryById: [NSNumber numberWithInt: id] entry: ze];
if (success == NO) {
NSLog(@"%@",zip.LastErrorText);
return;
}
|