Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

long integer value objective-c

I have long integer value ( ex: 2705758126 ) in NSString.

When i try to show it: NSLog(@"%i", [myValue integerValue]); it return: 2147483647.

How to show, compare and etc. this long integer

like image 766
Shyne Avatar asked Jul 18 '09 13:07

Shyne


2 Answers

Try with

NSLog(@"%lld", [myValue longlongValue]);
like image 54
IlDan Avatar answered Nov 01 '22 21:11

IlDan


The documentation recommends using @"%ld" and @"%lu" for NSInteger and NSUInteger, respectively. Since you're using the integerValue method (as opposed to intValue or longLongValue or whatever), that will be returning an NSInteger.

like image 24
Dave DeLong Avatar answered Nov 01 '22 20:11

Dave DeLong