NSUInteger not appearing properly on TestFlight

48 Views Asked by At

I've been testing my app on the simulator and device. There are labels that show NSIntegers and I've formatted them as:

[NSString stringWithFormat:@"%lu", (unsigned long)_qty]

This works. However, when I build my app for TestFlight, these labels come out as numbers like 580023223, for example.

I initialised _qty this way:

NSUInteger _qty;

_qty = 0;

Can anyone help? Thanks

1

There are 1 best solutions below

1
hyde On

If you don't initialise a variable with a value, it would have a random value from memory. You should try that:

NSUInteger _qty = 0;