Information Technology Reference
In-Depth Information
The Variables View isn't just a passive display. Right-click a variable to show the menu illustrated in Figure
15.14. You can use the options here to enable and disable data formatting and type information and to edit val-
ues by hand. For example, select the Edit Value option as shown in the figure, and type 0 into the box that ap-
pears next to the i variable. This resets the counter without restarting the application. You can now repeat the
count from the beginning.
FIGURE 15.14
Using the right-click menu to edit a value “live” after a breakpoint
Using expressions
You can add your own items to the Variables View using expressions. An expression is an extra customized list-
ing of an object, property, or variable. You can use expressions to extract properties and values from objects, so
you don't have to drill down the hierarchy to find them. Expressions can contain standard C, C++, and
Objective-C code, but they don't require the semicolon terminator. Expressions must be prefixed with a cast to
define the type.
Figure 15.15 shows a sample expression. Right-click anywhere in the Variables View, select Add Expression,
enter the following string, and click Save.
(NSString *) [window description]
You see a new entry in the view, which shows the result of running the description method on the win-
dow object. For a different result, replace window with aNotification . You'll see information about the
initial notification that is posted when the application completes its startup sequence.
Search WWH ::




Custom Search