When I use this code to convert a string inside a array to a long long
, it fails and prints out "0" because the string starts with "0x".
This is my array: NSArray <NSString *> *offsets = @["0x1003567"];
When I try to log it with this code:
NSLog(@"Offset: %lld", [offsets[0] longLongValue]);
It prints out: "0"
When I remove the "0x" from 0x1003567, it prints out the correct numbers.
However, I do need the "0x" in order to be able to use it.
Is there any way I can make it convert how I would want it?