开发者

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 obje开发者_运维百科cts 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"

Xcode 3.2 Debug: Seeing whats in a string?

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


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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜