SUCCEED

   

iphone 2013
Shodor > SUCCEED > Workshops > Archive > iphone 2013

Today Phil started the class by reviewing operators and arrays, which had been covered the previous day. Phil then had all of the workshop students open a calculator-like starter app that he made for the students prior to the beginning of the workshop. The starter app had five numbers going down the right side of the screen with a text field and a button on the left side. Each of the buttons had the name of a different operator (add, subtract, etc) and typing a number into the text field and pressing the button was supposed to apply the operator to the number on the right with the number in the text field. Thus if the number in on the right side was 100 and 10 was put in the text field and the button said "add" hitting the button would make the number on the right display 110.

However, only one operator button out of the five was functional. Phil had to instruct the students on how to make the other four operations work. He introduced the students to "if statements" and taught them about good programming practices like when to use "else if" instead of having a series of "if statements". Next, Phil moved on to the bottom portion of the app that was a text field and the operator buttons. These buttons, when pressed, were supposed to apply that operation using the number in the text field to every number along the upper right side. Phil walked the students through how to make all of the buttons work and had them copy code in order to get all of the labels to change.

After this, Phil taught the students about "for loops". These help programmers make long code shorter. Next, Gavin taught the students about "c type" functions, "objective-c" functions, and how to use them. He then instructed the class on how to use "objective-c" type functions to make large amounts of code into a much smaller loop that repeated a function with a changing argument.