Closed Jake6329 closed 7 years ago
This is intentional if the value doesn't fit into Swift's Int
(which as you mention in your update, it doesn't on a 32-bit device). There is some background/rationale in the discussion on #76.
I could see an argument for something like a getInt64()
. For now, though, your current options are:
Int64
yourself (try to get the value as an Int
, catch the value not convertible error and try to get the value as a String
, converting either to Int64
)String
regardless of the platform you're running on. If the value is something like an ID that you don't need to do any math on, this might be the most straightforward solution.
In terms of 64 bit integers, I found a 'strange' behavior of Freddy. Here's my test code:
And I get this result:
It seems that Freddy parses big integers as Strings, and I guess it might have to do something with the old 32bit iOS hardwares. Any suggestion on how to deal with integer sizes?
[UPDATE] Actually, I was running the test code in the 32bit hardware simulator. When I ran it later with the latest hardware simulator(iPad Pro), Freddy did parse the big integer as Int and there was no error. It still raises a question though. How do I manage to work with both 32 and 64 bit platforms? I wish there were something like
getInt64()
method for the cases where I'm sure that the value is in the range of 64 bit integers.