I'm using the popular class calle SSZipArchive to unzip a file, concretely this method:
+ (BOOL)unzipFileAtPath:(NSString *)path toDestination:(NSString *)destination progressHandler:(void (^)(NSString *entry, unz_file_info zipInfo, long entryNumber, long total))progressHandler completionHandler:(void (^)(NSString *path, BOOL succeeded, NSError *error))completionHandler
And I'm updating two uilabels text in the blocks inside, both of them are allocated, both of their texts are changed before, when I print the content of the uilabels the text is updated but the screen doesn't update it, I have to say that this method is loaded when I finish the download of a zip into a delegate method.
My code:
- (void)downloadManager:(id)sender finishedDownload:(ANDownload *)download {
if ( [[NSFileManager defaultManager] fileExistsAtPath:download.storeFile] ) {
NSLog(@"Download exists");
[self.labelStep setText:CustomLocalizedString(@"ZIP_DECOMPRESSING_MSG", nil)];
[SSZipArchive unzipFileAtPath:download.storeFile toDestination:self.saveFolderPath progressHandler:^(NSString *entry, unz_file_info zipInfo, long entryNumber, long total) {
//Your main thread code goes in here
NSString * labelProgressText = [NSString stringWithFormat:@"%ld / %ld", entryNumber, total];
self.labelProgress.text = labelProgressText;
} completionHandler:^(NSString *path, BOOL succeeded, NSError *error) {
NSLog(@"Succeeded %d in path: %@", succeeded, path);
if(succeeded){
.....