尝试将 iAd 移出屏幕时出错
按照 Apple 的要求,尝试在没有加载广告时让 iAds 关闭屏幕。他们给了我这段代码:
- (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,但这只会让事情变得更糟
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要使用
self.bannerIsVisible
,您需要将bannerIsVisible
声明为属性。To use
self.bannerIsVisible
you need to havebannerIsVisible
declared as a property.