Changing value of a NSNumber

objective-c

Solution

NSNumber is immutable. Actually, it's a subclass of NSValue, and all NSValues are immutable.

Problem

Is there a way to change the value contained in an NSNumber after it is created without making it point to a different NSNumber? ``` NSNumber *num = [NSNumber numberWithInt:0]; num = [NSNumber numberWithInt: 1]; // now num points to a different object, which I don't want. I want it the same object still, but different value. ```

Original source