fuzzygoat
fuzzygoat

Reputation: 26223

Xcode 3.2 Debug: Seeing whats in a string?

Does anyone know the display formatter that I would need to add to the summary field to display the contents of the NSString objects contained in the NSArray shown? I have already added the formatter below for NSArray so that it displays its contents...

"{(int)[$VAR count]} objects {(NSString *)[(NSArray *)$VAR description]}:s"

alt text

I would really like (0-6 marked in red) to display in "Summary" as follows:

0 = Monday

1 = Tuesday

2 = Wednesday

3 = Thursday ... etc.

gary

Upvotes: 8

Views: 1031

Answers (3)

jm.
jm.

Reputation: 23734

I got it to display monday, tuesday, wednesday, but not sure why yet:

  1. I started with this code to create an array like what you describe:

    NSArray * myArray2 = [NSArray arrayWithObjects:@"monday",@"tuesday",@"wednesday",nil];

    In debugger it didn't show the expected monday, tuesday, wednesday on each row.

  2. This step is important: In debugger, I double clicked on the summary and pasted in the string you were using:

    {(int)[$VAR count]} objects {(NSString *)[(NSArray *)$VAR description]}:s

    That didn't work.

  3. But immediately after, I clicked on the same summary field (it highlighted the string I just pasted), and then pressed the delete key, and then clicked return.

    Then it showed Monday, Tuesday, Wednesday on each row in array.

Upvotes: 1

the_mandrill
the_mandrill

Reputation: 30862

I've had very little success with the Xcode data formatters. It rarely seems to do what you'd expect. Creating a data formatter bundle is more work but tends to be slightly more reliable (however, I still find that much of the time it will say that variables are out of scope when they quite clearly aren't). The Xcode data formatter docs have a tutorial on creating a bundle.

Upvotes: 1

BJ Homer
BJ Homer

Reputation: 49054

{(NSString *)[$VAR description]}:s doesn't work?

Upvotes: 0

Related Questions