views:

124

answers:

1

Trying to make iAds go off screen when no ad is loaded, as per Apple's request. They gave me this code:

- (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;
 }
}

I made my view a delegate for iAds and whatnot, but whenever I try to compile, I get:

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

I tried adding a BOOL bannerIsVisible, but it just made things worse

+2  A: 

To use self.bannerIsVisible you need to have bannerIsVisible declared as a property.

macatomy
Thanks. I tried to declare it again and it worked. For some reason the add won't hide, though. What data type should bannerIsVisible be?
SeniorShizzle
@SeniorShizzle - This should be a BOOL, like you've already set it to be. Somewhere in your controller's initialization you need to set this to YES, if the iAd banner is visible on startup. If not, set it to YES when the banner first appears on the screen.
Brad Larson