I've got a small chunk of code which I've noticed is behaving differently for arm64
targets. I'm fetching a numeric string from JSON data, and then using integerValue
to convert the string to an integer. The string generally has thousands separators, in the form of a comma.
On non-64bit targets, (iPhone 4/s, 5/s, etc), everything works perfectly and I get the correct integer regardless of whether there is a comma separating the thousands. However, on arm64
, integerValue
only returns the first "chunk" of numbers, before the separator comma. I've included the code and a sample result to show what exactly is happening:
NSInteger value = [BTCValue integerValue];
[UIApplication sharedApplication].applicationIconBadgeNumber = value;
For example, on non-64bit targets:
BTCValue = @"54,321.00"
and value = 54321
.
On arm64 targets, however:
BTCValue = @"54,321.00"
and value = 54
.
It doesn't seem to matter whether value
is an int or an NSInteger, the same thing happens regardless. Is there something that I'm missing? I don't understand why everything works properly on armv7 but not arm64.