iOS / xcode - NSNumber literal updates being ignored by Xcode

214 Views Asked by At

1) I declare a NSNumber property is a view controller header file @property NSNumber *myNumber; 2) I set that property to a NSNumber literal and log the output:

self.myNumber = @9;
NSLog(@"myNumber is: %@", self.myNumber);

3) The above works as expected. Then I change the @9 to @10. and run the program. It does not work, the property is still set to a value of 9.

4) I make a small change to the NSLog text (a space, a full stop, anything) then rerun the program. It now does work! (updating to the new value, e.g. @10)

Any thoughts on why this is happening would be MUCH appreciated, thanks

1

There are 1 best solutions below

0
On BEST ANSWER

Sometimes, Xcode gets stuck on little things like this. When something weird like this happens, the first thing to try is a clean - CmdshiftK.