Given the following code:
int firstInt, secondInt;
firstInt = 5;
secondInt = 5;
NSNumber *firstNumber = [NSNumber numberWithInt:firstInt];
NSNumber *secondNumber = [NSNumber numberWithInt:secondInt];
Why on Earth do those two NSNumber instances are pointing to the same address?
This drives me crazy!
Of course, if you change secondInt to, say '4', all works as expected.
Thanks,
Jérémy
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…