Note that there are some explanatory texts on larger screens.

plurals
  1. POxcode 3.2.2 and objective-c 2.0 and debug: where are my object's property/instance variable values in debug?
    primarykey
    data
    text
    <p>working on a mac os project (meaning not iPhone) requiring 10.6 and is 64bit, allows me to use properties to generate both accessor methods and instance variables in the header file. but, during debug, i'm not seeing how to look at the object's properties values after they have been populated. is there some build setting that needs to be turned on?</p> <p>if i am declaring an object's instance variables (between {} in the header), then i can see those values (when they are used) during debug either in the debug window itself, or by using the cursor-hover over the highlighted line trick in the editor during a break, or by doing cli in gdb like 'p *object' for instance. </p> <p>old way:</p> <pre><code>@class Suit; @interface Card : NSObject { NSNumber *playOrder; Suit *suit; NSNumber *displayNumber; NSNumber *orderIndex; } @property(nonatomic, retain) Suit *suit; @property(nonatomic, retain) NSNumber *displayNumber; @property(nonatomic, retain) NSNumber *orderIndex; </code></pre> <p>new way:</p> <pre><code>@class Suit; @interface Card : NSObject @property(nonatomic, retain) Suit *suit; @property(nonatomic, retain) NSNumber *displayNumber; @property(nonatomic, retain) NSNumber *orderIndex; @property(nonatomic, retain) NSNumber *playOrder; </code></pre> <p>in this new-fangled 10.6 required 64bit idea (which seems simpler to me) none of these debug methods display the object's values. i figure that i must have something turned off, because this newer idea, doesn't seem better.</p> <p>gdb results for old way:</p> <pre><code>(gdb) po newCard New Card : 0 of Suit : Hearts (NSCalibratedRGBColorSpace 1 0 0 1). with orderIndex of: 1 (gdb) p *newCard $1 = { &lt;NSObject&gt; = { isa = 0x100002188 }, members of Card: playOrder = 0x0, suit = 0x200053a20, displayNumber = 0x20001bac0, orderIndex = 0x200012de0 } (gdb) </code></pre> <p>gdb results for new way:</p> <pre><code>(gdb) po newCard New Card : 0 of Suit : Hearts (NSCalibratedRGBColorSpace 1 0 0 1). with orderIndex of: 1 (gdb) p *newCard $3 = { &lt;NSObject&gt; = { isa = 0x100002188 }, &lt;No data fields&gt;} (gdb) </code></pre> <p>so looking at the docs for objective-c 2.0:</p> <p><a href="http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html#//apple_ref/doc/uid/TP30001163-CH17-SW3" rel="nofollow noreferrer">http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocProperties.html#//apple_ref/doc/uid/TP30001163-CH17-SW3</a> </p> <p>describes what i am referring to (synthesizing instance variables in 'modern' runtime), but what isn't said anywhere, is that if you do this, the values will not be available during debugging. </p> <p>i've found an <strong>SO</strong> page with pertinent information, but not focused on this effect: <a href="https://stackoverflow.com/questions/1007607/using-instance-variables-with-modern-runtime">Using instance variables with Modern Runtime</a></p> <p>what did i miss?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload