Join Todd Perkins for an in-depth discussion in this video Solution: Create two variables, part of Programming for Non-Programmers: iOS 7.
…There are multiple ways you could have approached this challenge.…And as long as you arrive at the…correct solution, any method you use can be correct.…Here is the method that I used.…In mainstoryboard.storyboard, I made sure that my utility view was showing,…and then I clicked and dragged two labels onto the screen.…So, there is one.…And there is another label.…Then, I created two variables, one for each label.…
I did that in ViewController.h.…At the end of line 11, I will go to…the next line, create an open curly brace and type enter.…And now I'm going to create an IBOutlet that is a UI label called name.…At this point, we need two different UI labels.…I'm going to show you a short cut to doing that.…One way is, we can select this line and copy with Cmd+C.…Go to the next line, paste the code with Cmd+V, and change name to age.…
But since there are two variables that are…the same data type, that is IBOutlet, UILabel.…We actually have a short cut.…I'll show you how to do that.…Going to delete that line of code.…
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.