Information Technology Reference
In-Depth Information
Understanding crashes
When an application crashes, the console appears automatically and displays a series of diagnostic messages
that can help you discover the cause of the crash.
Your projects will crash accidentally often enough. But as an exercise that illustrates how Xcode handles crash
event, you can create a crash deliberately. Add the following line to the application didFin-
ishLaunchingWithOptions: method of the app delegate of an iOS project, such as the IB project from
Chapter 7:
[window thisWillCrash];
The window object has no method called thisWillCrash , so the app crashes when it tries to execute this
line.
Figure 15.6 shows the result. If it's not already visible, the Debug Navigator appears automatically at the top
left. The message that caused the crash is highlighted in black. Internal messages associated with the crash are
shown in a lighter gray.
FIGURE 15.6
Displaying a crash event
Search WWH ::




Custom Search