mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-24 04:46:01 +08:00
Implementation of Object Mapping 2.0 design:
* Removed RestKit from inheritance hierarchy * Mappings are implemented as concrete classes * Mapper is much more flexible & powerful * Much more robust error handling * Serialization is reimplemented as an object mapping operation * Added ability to serialize to JSON natively * Reworked Core Data integration * Simplified the codebase substantially
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#import "RKClient.h"
|
||||
#import "../Support/Support.h"
|
||||
#import "RKURL.h"
|
||||
#import "Logging.h"
|
||||
|
||||
@implementation RKRequest
|
||||
|
||||
@@ -200,6 +201,7 @@
|
||||
}
|
||||
|
||||
- (void)sendAsynchronously {
|
||||
_sentSynchronously = NO;
|
||||
if ([self shouldDispatchRequest]) {
|
||||
#if TARGET_OS_IPHONE
|
||||
// Background Request Policy support
|
||||
@@ -251,6 +253,7 @@
|
||||
NSError* error;
|
||||
NSData* payload = nil;
|
||||
RKResponse* response = nil;
|
||||
_sentSynchronously = YES;
|
||||
|
||||
if ([self shouldDispatchRequest]) {
|
||||
[self prepareURLRequest];
|
||||
@@ -307,6 +310,8 @@
|
||||
- (void)didFinishLoad:(RKResponse*)response {
|
||||
_isLoading = NO;
|
||||
_isLoaded = YES;
|
||||
|
||||
RKLOG_NETWORK(RKLogLevelInfo, @"Body: %@", [response bodyAsString]);
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(request:didLoadResponse:)]) {
|
||||
[_delegate request:self didLoadResponse:response];
|
||||
|
||||
Reference in New Issue
Block a user