Today the teacher took us to realize a simple calculator, benefited greatly.
Just like every project, no matter the size, I first think of the teacher said that sentence, you have to put a good outline in the brain, think well step by step what to do, if the feeling is not clear enough to write down the notebook first.
1. Add button, color, font size 47
2. Add label, font size 80, color
3. Associate Input Button
4.label Global, take out the number above the button,
NSString *numberstring=[sender titleforstate:
UIControlStateNormal]
5. Set a text initial null value
6. Associating subtraction whataction
7. Empty the label display
8. Tag for button identification
9. Declare and record subtraction what, record the first number
10. Association =
11. Take the second number out
12. Judging subtraction
13. Display results
14. Modify empty Order
15. Association c key, function
Feel that doing a project to consider a lot, very test people's logical thinking ability, I think if a person programmed to do well, then his thinking ability must be great.
Lan Yi iOS Training Log 4 calculator implementation and learning experience