So, the joke in class was “will there be a HelloWorld27?”
Probably not, but we are up to HelloWorld4.
So the class is small, but made up of students with very different programming backgrounds. Two of the students are very comfortable in the Revolution environment, but are having some difficulty getting used to the C syntax. The other four students have used Java and/or Arduino, and while the syntax is different, they are finding it easier to adapt what they know to what we are doing.
I find for some students pictures are essential.
HelloWorld04
- Create a an image of yourself with the following dimensions:

- Save it as a png on the desktop
- Open Xcode and create a new project
- Create a View Based application
- Save it as HelloWorld04
- Open up the HelloWorld04ViewController.h file
- Create a UILabel pointer named label of type IBOutlet
- Below the closed curly brace create an (IBAction) named hello and pass it (id)sender
- Open the Implementation file and define the hello function so that the text of label is set to a message
- Save the files
- CTRL+click on the Resources folder and add the png. Make sure to Copy items into destination group’s folder(if needed)
- Open up the main nib file
- Double click on the HelloWorld04ViewController in the MainWindow.xib
- Click on the link
- From the library add a UIImageView
- In the attribute window set the image to your png
- From the library drag a UILabel onto the view. Adjust the size
- Clear the Text in the Text field
- Choose a color for the text in the attribute window
- From the library drag a button on to the view and change the label on the button to Press Me
- In the xib window click on File’s Owner and press ⌘+2.
- Connect label to the label in the view.
- connect hello: to the button and select Touch up inside
- Save the xib file
- Build and run
- Modify the code so that the text keeps toggling between two expressions.
- Add an NSLog() statement to print out the current text to the console.
- Save the xib file
- Build and run (⌘+⇧+R)