title: Accessing static variables that are simulating class variables from unit tests
body: <p>Is there an Objective-C runtime library function (<em>unlikely</em>) or set of functions capable of inspecting static (quasi-class level) variables in Objective-C? I know I can utilize a class accessor method but I'd like to be able to test without writing my code "for the test framework". </p>
  
  <p><em>Or</em>, is there a obscure plain C technique for external access to static vars? Note this information is for unit testing purposes—it needn't be suitable for production use. I'm conscious that this'd go against the intent of static vars... a colleague broached this topic and I'm always interested in digging into ObjC/C internals. </p>
  
  <pre><code>@interface Foo : NSObject
  + (void)doSomething;
  @end
  
  @implementation Foo
  static BOOL bar;
  + (void)doSomething
  {
    //do something with bar
  }
  @end
  </code></pre>
  
  <p>Given the above can I use the runtime library or other C interface to inspect <code>bar</code>? Static variables are a C construct, perhaps there's specific zone of memory for <code>static</code> vars? I'm interested in other constructs that may simulate class variables in ObjC and can be tested as well.</p>