1
votes

I am struggling with very simple thing: I receive some ids by http request as a string. I know they represent 64-bit integer id numbers. How can I convert them to the 64-bit Integers (NSNumber or NSInteger)?

Functions like:

[nsstring integerValue],
[nsstring intValue]

seems to be 32bit limited (max value:2147483647).

Any Hints?

Data model with 64bit integer properties compiles fine so it means iPhone supports such a numbers for a god sake. It must be some simple conversion method. It is so popular in http connection based devices.

2

2 Answers

3
votes

have you tried longLongValue ?

-1
votes

if they have a fixed length, you could cut them on each 9th number, make the intvalue of the cutted parts and add the values with the 10^9-factor. surely not the most elegant way, but it should work