Ios – Get a long value from an NSString

ioslong-integernsstringobjective-c

I need to get a long value from an NSString.

For example, I have this:

NSString *test = @"5437128";

and I need :

long myLong = 5437128;   

How I can get this long value from the NSString?

Thank you, it will help me!

Best Solution

long longVariable = [test longLongValue];  

See NSString documentation..