mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Added download progress
This commit is contained in:
@@ -444,6 +444,11 @@ typedef enum {
|
||||
*/
|
||||
- (void)request:(RKRequest *)request didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite;
|
||||
|
||||
/**
|
||||
* Sent when request has received data from remote site
|
||||
*/
|
||||
- (void)request:(RKRequest*)request didReceivedData:(NSInteger)bytesReceived totalBytesReceived:(NSInteger)totalBytesReceived totalBytesExectedToReceive:(NSInteger)totalBytesExpectedToReceive;
|
||||
|
||||
/**
|
||||
* Sent to the delegate when a request was cancelled
|
||||
*/
|
||||
|
||||
@@ -187,6 +187,9 @@ extern NSString* cacheURLKey;
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
|
||||
[_body appendData:data];
|
||||
if ([[_request delegate] respondsToSelector:@selector(request:didReceivedData:totalBytesReceived:totalBytesExectedToReceive:)]) {
|
||||
[[_request delegate] request:_request didReceivedData:[data length] totalBytesReceived:[_body length] totalBytesExectedToReceive:_httpURLResponse.expectedContentLength];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSHTTPURLResponse *)response {
|
||||
|
||||
Reference in New Issue
Block a user