View Single Post
  #1 (permalink)  
Old April 19th, 2010, 06:04 PM
TonyMacDev TonyMacDev is offline
Registered User
 
Join Date: Apr 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Debugger Data formatters

This is my object structure

MyObjectA
{
NSURL * url;
}

MyObjectB : MyObjectA
{
...
}

For discussion, avariable instanceOfMyObjectB has been created. Looking at the variable window, I see this:

instanceOfMyObjectB 0x....
MyObjectA {...}
NSObject {...}
url 0x... out of scope


The URL is not printed out, out of scope is printed and it contains just the format string({(unichar *)Xcode_CFStringSummary((void *)[$VAR description], $ID)}:s, default one provided by XCode). If I go to the debugger console and do 'po instanceOfMyObjectB.url', OR po [instanceOfMyObjectB.url description] it prints out the URL correctly. In fact, all the members of MyObjectA only show their format string but all print out correctly in the debugger console.

Working with this a bit, it looks like there is an issue with $VAR. If I replace $VAR with instanceOfMyObjectB.url, it works fine. But this formatter is now specific to the variable name.

Any Clues? I've read the section on formatters in your book and there is one section where you talk about casting the derived object to the superclass. However, that doesn't seem to help.

Thanks!