Sometimes you need to put a number value in a text field. To do that, you'll need to convert the number to a string. See how the process works in this video.
- [Instructor] So we've looked at putting a string value…inside of a label.…So we can take a string value and put it right in there,…but what if you're making a game,…an in the game the user has a score,…and you want the label to display the player's score.…The thing is, the score is not a string, it's an integer.…It's a number.…So how do we get a number value and convert it…into a string value?…We can do that by going into viewDidLoad.…
And what I'm going to do is create a variable inside of here.…So instead of creating it up here outside of viewDidLoad…and making an instance variable, I'm going to create…what is called a local variable inside viewDidLoad.…A variable declared inside of a method…inside of these curly braces right here is only known…to that method.…So for example, if I wanted to access this label…that I've created here on line 12, I can reference it…inside of a method.…
I can reference it in viewDidLoad like we've done here.…I can also reference it inside didReceiveMemoryWarning.…As I start to type it, you can see the code hinting…
- Installing Xcode
- Creating an Xcode project
- Configuring the iOS Simulator
- Understanding variables
- Connecting visual objects to variables
- Understanding methods
- Connecting a button to a method
- Using conditional statements
- Setting up the user interface (UI)
- Building a complete iOS app
Skill Level Beginner
1. Set Up Your Coding Environment
Create an Xcode project4m 19s
2. Programming Building Blocks: Variables
3. Programming Building Blocks: Methods
4. Programming Building Blocks: Conditional Statements
5. Plan and Prepare the App
6. Build a Full Application
Next steps3m 11s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
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.