Valid JSON, but 'Cocoa error 3840' from AFNetworking/NSJSONSerialization Valid JSON, but 'Cocoa error 3840' from AFNetworking/NSJSONSerialization json json

Valid JSON, but 'Cocoa error 3840' from AFNetworking/NSJSONSerialization


NSJSONSerialization uses NSDecimalNumber to represent numbers, and

[NSDecimalNumber decimalNumberWithString:@"4.439049394553e-312"]

already returns NaN, because NSDecimalNumber can represent only numbers

mantissa x 10^exponent         where `-128 <= exponent <= 127`.

So this seems to be a "restriction" (or bug) of NSJSONSerialization, that it works only withnumbers in a certain range.

I made a quick test with "SBJsonParser" and it had the same problem.