title: How to resolve "Member access into incomplete type" error
body: <p>I am trying to integrate iAd into a cocos2d-x project as described in:
  <a href="http://becomingindiedev.blogspot.com.es/2015/02/integrating-iad-in-cocos2d-x-v3x.html" rel="noreferrer">http://becomingindiedev.blogspot.com.es/2015/02/integrating-iad-in-cocos2d-x-v3x.html</a></p>
  
  <p>AdBanner.h</p>
  
  <pre><code> #import &lt;Foundation/Foundation.h&gt;  
   #import &lt;iAd/iAd.h&gt;  
   @class RootViewController;   
   @interface AdBanner : NSObject&lt;ADBannerViewDelegate&gt;  
   {  
     UIWindow* window;  
     RootViewController* rootViewController;  
     ADBannerView* adBannerView;  
     bool adBannerViewIsVisible;  
   }  
  </code></pre>
  
  <p>AdBanner.mm</p>
  
  <pre><code>@implementation AdBanner
  
   -(id)init  
   {  
     if(self=[super init])  
     {  
       adBannerViewIsVisible = YES;  
       rootViewController =  
         (RootViewController*) [[[UIApplication sharedApplication] keyWindow] rootViewController];  
       window = [[UIApplication sharedApplication] keyWindow];  
       [self createAdBannerView];  
     }  
     return self;  
   }  
  
  -(void)layoutAnimated:(BOOL)animated
  {
      CGRect bannerFrame = adBannerView.frame;
      //Has the banner an advestiment?
      if ( adBannerView.bannerLoaded &amp;&amp; adBannerViewIsVisible )
      {
          NSLog(@"Banner has advertisement");
          bannerFrame.origin.y = window.bounds.size.height - bannerFrame.size.height;
      } else
      {
          NSLog( @"Banner has NO advertisement" );
          //if no advertisement loaded, move it offscreen
          bannerFrame.origin.y = window.bounds.size.height;
      }
      [UIView animateWithDuration:animated ? 0.25 : 0.0 animations:^{
          [rootViewController.view layoutIfNeeded]; //Member access into incomplete type "RootViewController"
          adBannerView.frame = bannerFrame;
      }];
  }
  @end
  </code></pre>
  
  <p>The line at the bottom in AdBanner.mm gives the error:</p>
  
  <pre><code>    [rootViewController.view layoutIfNeeded]; //Member access into incomplete type "RootViewController"
  </code></pre>
  
  <p>How do I resolve this ?</p>