title: Objective-C: instance variables out of scope in debugger
body: <p>I have a superclass and a subclass, both of which define instance variables. </p>
  
  <p>Rough outline of superclass:</p>
  
  <pre><code>/* GenericClass.h */
  @interface GenericClass : NSObject {
      /* some variables */
  }
  @end
  /* GenericClass.m */
  @implementation GenericClass
      /* ... */
  @end
  </code></pre>
  
  <p>Outline of subclass:</p>
  
  <pre><code>/* SpecificClass.h */
  #import "GenericClass.h"
  @interface SpecificClass : GenericClass {
      NSMutableString *str;
  }
  /* SpecificClass.m */
  #import "SpecificClass.h"
  @implementation SpecificClass
  - (void)aMethod {
      //Debugger reports str as out of scope
      str = [[NSMutableString alloc] initWithCapacity:100];
      //Works fine:
      self-&gt;str = [[NSMutableString alloc] initWithCapacity:100];
      //Doesn't compile as I haven't defined @property/@synthesize:
      self.str = [[NSMutableString alloc] initWithCapacity:100];
  }
  </code></pre>
  
  <p>When I am using classes that inherit directly from NSObject, one doesn't need the self-> pointer. Note that there is no object with the name str defined in the parent GenericClass. 
  So, my question is, why is str out of scope when not referenced as self->str? The code in itself works, but I can't read the variable with the debugger</p>