Wednesday, October 13, 2010

Custom Data Formatter for NSIndexPath

Have been using UITableViews for a long time, always complained to myself why cannot I see section and row right away in debugger or variable popup. Something like with CGRect or CGSize. Well, this morning I was doing something completely different. Suddenly solving NSIndexPath debug problem was the much easier task:
section={(int)[$VAR section]}, row={(int)[$VAR row]}
Start debugging anything with a local NSIndexPath variable, even a temporary dummy one. Put breakpoint right after it. When debugger stops, double click on debugger window summary row for NSIndexPath variable and paste the string above there. Seems to stick even after restarting Xcode.

Now I can continue fixing The Real Problem.

1 comment:

  1. Awesome, didn't know that column was editable. Just googled a little bit more about that and found http://stackoverflow.com/questions/1096352/strange-descriptions-for-arrays-in-xcode-debugger/1096425#1096425
    So apparently those summaries are saved to ~/Library/Application Support/Developer/Shared/Xcode/CustomDataViews/CustomDataViews.plist

    ReplyDelete