https://github.com/mattconnolly/ZipArchiveを使用してループ内のファイルを解凍しています。問題は、解凍のループにあります。ラベルを更新できません。私のコード:
-(void) UnzipFiles
{
for (int i=0; i < zippedFiles.count; i++)
{
[lb7 setText:[NSString stringWithFormat:@"Unziping file %d/%d",i+1,zippedFiles.count]]; //not working
NSString *zipFilePath = [documentsDirectory stringByAppendingPathComponent:[zippedFiles objectAtIndex:i]];
NSString *output = [documentsDirectory stringByAppendingPathComponent:[unzipFolders objectAtIndex:i]];
NSLog(@"Unziping: %@ ",[zippedFiles objectAtIndex:i]);
NSLog(@"To: %@",[unzipFolders objectAtIndex:i]);
ZipArchive* za = [[ZipArchive alloc] init];
if( [za UnzipOpenFile:zipFilePath] ) {
if( [za UnzipFileTo:output overWrite:YES] != NO )
{
NSLog(@"Unziped %@ ",[zippedFiles objectAtIndex:i]);
}
[za UnzipCloseFile];
[self deleteFile:[zippedFiles objectAtIndex:i]];
}
else
{
NSLog(@"The file %@ not exist",[zippedFiles objectAtIndex:i]);
}
doneBtn.hidden = NO;
[lb7 setText:@""];
}
}