Objective-c – Inspecting the contents of an array in the Xcode debugger


Let's say I create an array:

NSArray *newArray = [NSArray arrayWithObjects:@"foo", @"bar", @"sdfsf", nil];

In Xcode, when I stop at a breakpoint and inspect newArray I see that it says "3 Objects", yet when I click the disclosure triangle all I see is one NSObject and there seems to be no way to see what that array contains.

In practice I am working with an array of custom objects and it is a royal pain to see the nesting or inspect the properties of them.

Can anyone provide some insight on a better way to use this?

Best Solution

If it is in scope you can just type

po newArray 

into the debugger and it will print the description.

Or if you prefer clicking things then just right click the object in the left panel pof the console and then click "Print Description of ..."