尝试将iAds关闭屏幕时出错

时间:2010-07-02 01:51:06

标签: iphone objective-c advertisement

根据Apple的要求,尝试在没有加载广告时让iAd离开屏幕。他们给了我这段代码:

- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
 if (self.bannerIsVisible)
 {
  [UIView beginAnimations:@"animateAdBannerOff" context:NULL];
   // assumes the banner view is at the top of the screen.
  banner.frame = CGRectOffset(banner.frame, 0, -50);
  [UIView commitAnimations];
  self.bannerIsVisible = NO;
 }
}

我让我的视图成为iAds的代表和诸如此类的东西,但每当我尝试编译时,我得到:

"Request for member 'bannerIsVisible' in something not a structure or union

我尝试添加BOOL bannerIsVisible,但它只会让事情变得更糟

1 个答案:

答案 0 :(得分:2)

要使用self.bannerIsVisible,您需要将bannerIsVisible声明为属性。