开发者

SBJSONParser on large integer

开发者 https://www.devze.com 2023-04-08 10:39 出处:网络
I\'m using json-framework to parse JSON data in an iPhone project. But there\'s a large number in the json data, such as 10432159274, it will make NSNumber overflow. In the SBJsonParser.h, the doc say

I'm using json-framework to parse JSON data in an iPhone project. But there's a large number in the json data, such as 10432159274, it will make NSNumber overflow. In the SBJsonParser.h, the doc says Numbers in JSON will be converted to NSNumber or NSDecimalNumber. How can I use it so the large integer will be parsed as a NSDecimalNumber? Thanks开发者_StackOverflow社区.


I find the solution, updating to the newest version of SBJSON will solve it. The new version using numberWithLongLong to represent integers that has up to 19 digit.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号