Please note, this blog entry is from a previous course. You might want to check out the current one.
Add a +/- operation which changes the sign of the number in the display. Be careful with this one. If the user is in the middle of entering a number, you probably want to change the sign of that number and let them continue entering it, not force an enterPressed like other operations do. But if they are not in the middle of entering a number, then it would work just like any other single-operand operation (e.g. sqrt).
Add the “+/-” button in the storyboard by copying an operation button.
If the user is in the middle of entering a number, we just change the display and the history in operationPressed inside CalculatorViewController.m:
Continue reading “Assignment #1 Extra Task #3”