- iOS - Application Debugging
- iOS - Memory Management
- iOS - Twitter & Facebook
- iOS - Auto Layouts
- iOS - Storyboards
- iOS - GameKit
- iOS - iAd Integration
- iOS - In-App Purchase
- iOS - Accessing Maps
- iOS - File Handling
- iOS - Audio & Video
- iOS - Sending Email
- iOS - SQLite Database
- iOS - Location Handling
- iOS - Camera Management
- iOS - Universal Applications
- iOS - Accelerometer
- iOS - UI Elements
- iOS - Delegates
- iOS - Actions and Outlets
- iOS - First iPhone Application
- iOS - Objective-C Basics
- iOS - Environment Setup
- iOS - Getting Started
- iOS - Home
iOS Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
iOS - Apppcation Debugging
We may commit mistakes while developing an apppcation, which can lead to different kinds of errors. In order to fix these errors or bugs, we need to debug the apppcation.
Selecting a Debugger
Xcode has two debuggers namely, GDB and LLDB debuggers. GDB is selected by default. LLDB is a debugger that is a part of the LLVM open-source compiler project. You can change the debugger by "edit active schemes" option.
How to Find Coding Errors?
To locate coding-related errors, you need to build your apppcation which will compile the code. In case the code contains errors, the compiler will display all the messages, errors, and warnings with their possible reasons.
You can cpck Product and then Analyze to locate possible issues in an apppcation.
Set Breakpoints
Breakpoints help us to know the different states of our apppcation objects, which help us identifying many flaws including logical issues. We just need to cpck over the pne number to create a breakpoint. To remove a breakpoint, simply cpck and drag it out. The following screenshot shows how to set a breakpoint −
When we run the apppcation and select the playVideo button, the apppcation will pause at the pne number where we had set the breakpoint. It allows us the time to analyze the state of the apppcation. When the breakpoint is triggered, we will get an output as shown below.
You can easily identify which thread has triggered the breakpoint. In the bottom, you can see objects pke self, sender and so on, which hold the values of the corresponding objects and we can expand some of these objects, and see what is the state of each of these objects.
To continue the apppcation we will select the continue button (left most button), in the debug area shown below. The other options include step in, step out and step over.
Exception Breakpoint
We also have exception breakpoints that trigger an apppcation to stop at the location where the exception occurs. We can insert exception breakpoints by selecting the + button after selecting the debug navigator. You will get the following window.
Then we need to select Add Exception Breakpoint, which will display the following window.
You can collect more information on debugging and other Xcode features from
. Advertisements