Skip to content
Browse files

Try a little harder to make JSONDecoder optional at link-time

  • Loading branch information...
1 parent ea851ed commit 912d36f3ca267b74b1d4aa155b3c5a4a24ab35a9 @NachoMan committed Oct 29, 2011
Showing with 2 additions and 3 deletions.
  1. +2 −3 AFNetworking/AFJSONRequestOperation.m
View
5 AFNetworking/AFJSONRequestOperation.m
@@ -117,16 +117,15 @@ - (id)responseJSON {
if ([self.responseData length] == 0) {
self.responseJSON = nil;
} else {
-
+ Class jsonDecoder = NSClassFromString(@"JSONDecoder");
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_4_3 || __MAC_OS_X_VERSION_MIN_REQUIRED > __MAC_10_6
if ([NSJSONSerialization class]) {
self.responseJSON = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&error];
} else {
- Class jsonDecoder = NSClassFromString(@"JSONDecoder");
self.responseJSON = [[jsonDecoder decoder] objectWithData:self.responseData error:&error];
}
#else
- self.responseJSON = [[JSONDecoder decoder] objectWithData:self.responseData error:&error];
+ self.responseJSON = [[jsonDecoder decoder] objectWithData:self.responseData error:&error];
#endif
}

0 comments on commit 912d36f

Please sign in to comment.
Something went wrong with that request. Please try again.