Join Todd Perkins for an in-depth discussion in this video Setting up variables and functions, part of Programming for Non-Programmers: iOS 7.
…Now, we'll set up the variables and functions that…we're going to be working with in our calculator application.…Remember that we're following our plan that we already created.…So, in viewcontroller.h, I'm going to go right below line…11 and create a new line and add some curly braces.…In there, I'm going to create my variables.…I have two integer variables.…One called Total.…And one called Mode.…Then I have an NS String called Value String.…IB Outlet that is a UI Label that's called Label.…
Then a Boolean variable called Last Button Was Mode.…And I'm using camel case for that.…Now I'm going to declare a few functions.…So below the curly braces, hyphen, open parentheses, and then IB Action.…Now let X code complete that for me by pressing Return on my keyboard.…I'll type, Tapped Clear for the name of the function, and…then I'll put a semicolon at the end of the line.…Now, I'll select this line of code, and I'll copy…it with Command C and go to the next line.…
Now, I'm going to use Command V to paste this code four times.…
If you find you'd like to learn more, see iOS App Development Essential Training, Foundations of Programming: Fundamentals, or any of the other programming courses in our library.
- Installing Xcode
- Creating an Xcode project
- Configuring the iOS Simulator
- Understanding variables
- Connecting visual objects to variables
- Understanding functions, methods, and selectors
- Connecting a button to a function
- Using conditional statements
- Setting up the user interface
- Connecting code elements to build an app
Skill Level Beginner
1. Setting Up Your Coding Environment
Creating an Xcode project1m 55s
2. Programming Building Blocks: Variables
3. Programming Building Blocks: Functions
4. Programming Building Blocks: Conditional Statements
Using conditional statements5m 21s
5. Building Your First Full Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.