Merge branch 'master' of github.com:gowalla/AFNetworking
This commit is contained in:
commit
9e107d6a7b
1 changed files with 9 additions and 3 deletions
|
|
@ -23,6 +23,8 @@
|
||||||
#import "AFJSONRequestOperation.h"
|
#import "AFJSONRequestOperation.h"
|
||||||
#import "JSONKit.h"
|
#import "JSONKit.h"
|
||||||
|
|
||||||
|
#include <Availability.h>
|
||||||
|
|
||||||
@implementation AFJSONRequestOperation
|
@implementation AFJSONRequestOperation
|
||||||
|
|
||||||
+ (id)operationWithRequest:(NSURLRequest *)urlRequest
|
+ (id)operationWithRequest:(NSURLRequest *)urlRequest
|
||||||
|
|
@ -61,13 +63,17 @@
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
id JSON = nil;
|
id JSON = nil;
|
||||||
|
|
||||||
|
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_4_3
|
||||||
if ([NSJSONSerialization class]) {
|
if ([NSJSONSerialization class]) {
|
||||||
JSON = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
|
JSON = [NSJSONSerialization JSONObjectWithData:data options:0 error:&error];
|
||||||
} else {
|
} else {
|
||||||
JSON = [[JSONDecoder decoder] objectWithData:data error:&error];
|
JSON = [[JSONDecoder decoder] objectWithData:data error:&error];
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
JSON = [[JSONDecoder decoder] objectWithData:data error:&error];
|
||||||
|
#endif
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
if (failure) {
|
if (failure) {
|
||||||
failure(error);
|
failure(error);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue