![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Objective-C) Transition from ZipEntry.NextEntry to ZipEntry.GetNextProvides instructions for replacing deprecated NextEntry method calls with GetNext. Note: This example requires Chilkat v11.0.0 or greater.
#import <CkoZip.h> #import <CkoZipEntry.h> // ------------------------------------------------------------------------ // The NextEntry method is deprecated. // See below or code showing how to rewrite using EntryAt/GetNext CkoZip *zip = [[CkoZip alloc] init]; BOOL success = [zip OpenZip: @"qa_data/zips/xml_files.zip"]; if (success != YES) { NSLog(@"%@",zip.LastErrorText); return; } CkoZipEntry *entry = [zip FirstEntry]; if (zip.LastMethodSuccess == NO) { NSLog(@"%@",@"This zip archive is empty."); return; } BOOL finished = NO; while (finished == NO) { if (entry.IsDirectory == NO) { NSLog(@"%@",entry.FileName); } else { NSLog(@"%@%@",@"(directory) ",entry.FileName); } CkoZipEntry *next = [entry NextEntry]; if (entry.LastMethodSuccess == NO) { finished = YES; } entry = next; } [zip CloseZip]; NSLog(@"%@",@"----"); // ------------------------------------------------------------------------ // Do the equivalent using EntryAt/GetNext. success = [zip OpenZip: @"qa_data/zips/xml_files.zip"]; CkoZipEntry *ze = [[CkoZipEntry alloc] init]; [zip EntryAt: [NSNumber numberWithInt: 0] entry: ze]; BOOL entryValid = YES; while (entryValid == YES) { if (ze.IsDirectory == NO) { NSLog(@"%@",ze.FileName); } else { NSLog(@"%@%@",@"(directory) ",ze.FileName); } entryValid = [ze GetNext]; } [zip CloseZip]; |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.