title: Adding C++ Object to Objective-C Class
body: <p>I'm trying to mix C++ and Objective-C, I've made it most of the way but would like to have a single interface class between the Objective-C and C++ code.  Therefore I would like to have a persistent C++ object in the ViewController interface.</p>
  
  <p>This fails by forbidding the declaration of 'myCppFile' with no type:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  #import "GLView.h"
  #import "myCppFile.h"
  
  @interface GLViewController : UIViewController &lt;GLViewDelegate&gt;
  {
      myCppFile cppobject;
  }
  
  @end
  </code></pre>
  
  <p>However this works just fine in the .mm implementation file (It doesn't work because I want cppobject to persist between calls)</p>
  
  <pre><code>#import "myCppFile.h"
  @implementation GLViewController
  - (void)drawView:(UIView *)theView
  {
      myCppFile cppobject;
      cppobject.draw();
  }
  </code></pre>