Xcode debugger does not display the value of my variables.
Q: The debugger doesn't show my variables' value. How can I view them?
A: The debugger may not show the value of your variables for any of the following reasons:
The Optimization level is not set to None for the Debug configuration.
Be sure to set it to
None
for Objective-C apps as shown in Figure 1 and for Swift apps as shown in Figure 2.
The Build Configuration pop-up menu is set to Release in the scheme editor's Run action settings pane.
In Xcode, open the scheme editor by choosing Product > Scheme > Edit Schemeā¦, select the Run action for your app in the scheme actions pane, then set Build Configuration to
Debug
as seen in Figure 3.
Document Revision History
Date | Notes |
---|---|
2017-02-09 | New document that describes causes that can prevent the debugger from showing the value of your variables. |
Copyright © 2017 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2017-02-09