Question

I'm using RestKit 0.20.3 for an iOS 6 (or higher) app, and I can successfully upload a file to a server using this example.

My question is how can I implement an upload progress indicator (I only need the progress information) to display it to the user. Isn't there any implementation in RestKit?

Thanks a lot!

Était-ce utile?

La solution

The implementation is in AFNetworking.

After you create the request and operation add the setUpload progress block to the operation. That will give you the data needed for your progress indicator:

[operation.HTTPRequestOperation setUploadProgressBlock:^(NSUInteger bytesWritten, long long totalBytesWritten, long long totalBytesExpectedToWrite) {
        NSLog(@"Uploading!");
    } ];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top