tags:

views:

339

answers:

3

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

A: 

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

BJ Homer
Just tried it and I could not get it to work with an NSArray of NSStrings.
fuzzygoat
You're right. I'll see if I can find anything else.
BJ Homer
+1  A: 

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.

the_mandrill
A: 

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.

jm