As we konw for the iPhone Device we can use "ifaddrs" to monitoring the user's data. reference to this link:"iPhone Data Usage Tracking/Monitoring", but how to monitoring the download data of current process in iOS?
Asked
Active
Viewed 191 times
1 Answers
0
Use NSURLSessionDownloadTask and implement it's delegate
-(void)URLSession:(NSURLSession *)session
downloadTask:(NSURLSessionDownloadTask *)downloadTask
didWriteData:(int64_t)bytesWritten
totalBytesWritten:(int64_t)totalBytesWritten
totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite
{
NSLog(@"%f / %f", (double)totalBytesWritten,
(double)totalBytesExpectedToWrite);
}
Complete tutorial can be found here: http://www.raywenderlich.com/51127/nsurlsession-tutorial

Thanh-Nhon Nguyen
- 3,402
- 3
- 28
- 41