The debugger enables you to debug apps by showing you values of variables and other useful information. See how it works in this video.
- [Todd] Xcode has some great tools for debugging your code.…Take a look at this simple code that I have here.…It creates an Optional object,…then sets it to nil,…and then, force unwraps it in a print statement.…Watch what happens when I run the application.…So the build succeeds,…and then, while the app is running,…we get this application pausing,…and then, we find that we have an error message here.…Now, when we get to this error message,…you could actually click on the little hamburger right here,…and you could see the full message.…
It says fatal error in Thread 1,…unexpectedly found nil while unwrapping an Optional value.…So if there's a runtime error like this,…Xcode will actually pause the running application,…and what you see in the navigator…is actually the debug navigator over here on the left,…and then at the bottom of the screen,…you see the debug area.…These can be customized through Xcode Behaviors,…as we we looked at in a previous movie.…
If you go into Behaviors in Xcode Preferences,…then find When Running, Pauses,…
- Installing Xcode
- Creating your first project
- Editing code
- Creating snippets
- Prototyping in playgrounds
- Implementing version control with Git
- Building and connecting the interface
- Compiling and debugging apps in Xcode
- Creating workspaces for sharing resources and code
Skill Level Beginner
1. Getting Started
2. Edit Code
3. Source Control
4. Interface Builder Basics
5. Compile and Debug
Create a workspace2m 51s
Next steps1m 5s
- 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.