我的故事板中有一个 iAd 横幅,并将一个插座拖到我的班级。我现在只是尝试做一个简单的实现(没有动画),但是当我尝试设置 self.adBanner.isHidden 时,不明白为什么“没有 setter method 'setIsHidden' for assignment to property”作为错误抛出? 我已经包含了 iAd 框架。
#import "MyClass.h"
#import <iAd/iAd.h>
@interface MyClass () <ADBannerViewDelegate>
@property (weak, nonatomic) IBOutlet ADBannerView *adBanner;
@end
@implementation MyClass
@synthesize adBanner = _adBanner;
- (void)viewDidLoad {
[super viewDidLoad];
self.adBanner.delegate = self;
self.adBanner.isHidden = YES;
}
- (void)bannerViewDidLoadAd:(ADBannerView *)banner {
self.adBanner.isHidden = NO;
}
- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error {
self.adBanner.isHidden = YES;
}
@end