Error trying to use AFNetworking downloadProgress in Obj C

0

I'm trying to use progressBar with the Objective C language to show the progress of the download using the AFNetworking class method, like the following code:

                AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
            manager.responseSerializer = [AFHTTPResponseSerializer serializer];

            [[manager dataTaskWithRequest:request uploadProgress:nil downloadProgress:^(NSProgress * _Nonnull downloadProgress) {
                NSLog(@"o downloadProgress is %@", downloadProgress);
            } completionHandler:^(NSURLResponse * _Nonnull response, id  _Nullable responseObject, NSError * _Nullable error) {
                if (!error) {

                } else {

                }
            }] resume];

But the following NSLog is not running:

NSLog(@"o downloadProgress is %@", downloadProgress);

Please, some idea to solve this?

    
asked by anonymous 03.01.2019 / 02:51

0 answers