Join Todd Perkins for an in-depth discussion in this video Using primitive variables, part of Programming for Non-Programmers: iOS 7.
- View Offline
…Variables fit into two general categories.…There are primitive variables and pointer variables.…Primitive variables are simple data types, like numbers and true or false values.…So that's what we'll look at here.…We'll talk about pointer variables later on.…I'm working in viewController.m which you can access by single clicking on…it from the project navigator on the left side of your screen.…For writing code, I actually don't need any of this information on the right side…of the screen, so I'm going to hide that menu by clicking the top right button.…
So, now I'm going to scroll down inside of my code, and look at line 17.…There's a…hyphen and it says void and viewDidLoad.…That's the name of something called the function.…We'll talk about functions in more detail later on, but the code that…we're concerned about is inside of the curly braces following that function name.…Inside of those curly braces, which in my code is on line 20, you'll find a comment.…Remember that comments start with two forward slashes.…
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