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