Recently I found interesting problem connected with NSNumber initialization.
The difference occurred between simulator (9.3.1) and device (9.3.1).
Let assume that we've got int x = 2; Now we're initializing NSNumber and passing it to a method.
NSNumber *test = [NSNumber numberWithInt:self.x];
[self.method setTestNumber: test];
This two lines had a correct result on both simulator and device.
BUT using only this line
[self.method setTestNumber:[NSNumber numberWithInt:self.x]];
had quite unexpected result. Running it on simulator NSNumber intValue was equal to 2.
Running it on device had incorrect random value. How is that possible? Device is iPad 4 A1458. Also tested on iPad 3 16GB. The same problem occurred. Can you verify this problem?