Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 4 debugging

since migrating to Xcode 4 I am totally perplexed by the debug view inasmuch as I am unable to see the values of arrays / dictionaries etc.

Under Xcode 3 I could view debug console and see the actual values stored?

like image 368
user7865437 Avatar asked Dec 28 '22 23:12

user7865437


2 Answers

Debugging information now appears in the debug navigator (Cmd-5) and the debug area (Shift-Cmd-Y).

You can have these areas show up by default when you run the application (or hit a breakpoint) by toggling the options in the "Behaviors" tab of Xcode's preferences.

like image 87
一二三 Avatar answered Dec 30 '22 13:12

一二三


To see values inside arrays in xcode debug area choose the GDB debugger in your project scheme and have the variables you want to see defined as private variables.

Starting in xcode 4 the default debugger is LLDB. To change to GDB click on project name in schemes (next to "Stop" button near top of project window) Choose "Edit Scheme..." and then choose GDB in Debugger drop down.

One way to define a property variable so it can be seen in debug area is to define a private variable in the header file which has the @property statement.

@interface SomeObject : NSObject {
@private
    NSMutableArray *someArray;  // Allows visibility in Debug Area 
}
@property (nonatomic, strong) NSMutableArray *someArray;
@end
like image 25
MindSpiker Avatar answered Dec 30 '22 12:12

MindSpiker