p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Professional Xcode 3 (http://p2p.wrox.com/forumdisplay.php?f=549)
-   -   Debugger Data formatters (http://p2p.wrox.com/showthread.php?t=79102)

TonyMacDev April 19th, 2010 06:04 PM

Debugger Data formatters
This is my object structure

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.


All times are GMT -4. The time now is 12:27 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.