May be due to night rest too late, combined with the two days of most of the course content for training camp learning content, class is always a bit sleepy;
Today's study content is as follows:
1. Variable scope Local variables global variables
2.bool value 0 or 1
3.if statement else else if
4.switchCase
5. Button plus Tag
6.for Cycle
7.NSTimer
In class, the calculator strengthens the application of the variable scope and the IF statement;
The cycle of color squares enhances the application of various for loops;
Every question the teacher will write down the steps to clear our mind for example the following calculator procedure:
Calculator steps:
1. Build the interface (a text input box a label five buttons)
2. On the inside of the subtraction operator button, save the user-entered number with a global variable and record the variable with a global int type subtraction Empty text input box
3. In the Equals button to the user input of the second number to be saved with a local variable, to determine whether the previously saved int value is the addition or subtraction or multiplication do the corresponding operation to obtain results
4. Display the results in the label
This helps us to later in the work of the organization of the large project into a number of small projects, and then solve the problem one after the other to help a lot of work.
Lan Yi IOS variable action for loop Nstimer