-2

这是我尝试放入 iAd 的代码,但它不起作用。任何帮助将不胜感激,因为我对使用 Xcode 非常陌生。提前致谢

.m 文件

adView = [[ADBannerView alloc]initWithFrame:CGRectZero];
adView.frame = CGRectOffset(adView.frame, 0, -50);
adView.autoresizingMask = [NSSet setWithObject:**incompatible pointer to integer conversion assigning to 'UIViewAutoresizing' (aka enum UIViewAutoresizing)**
[ADBannerView setAutoresizingMask:UIViewAutoresizingFlexibleWidth]];**no known class for selector 'setAutoresizingMask'**
[self.view addSubview:adView];
adView.delegate=self;
self.bannerIsVisible=NO;
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
4

1 回答 1

0

必须为 UIView 实例而不是类设置自动调整大小掩码。我不确定为什么在您的第三行中尝试将其添加到集合中。这有效:

adView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

如果您需要多个,则使用按位或运算符将它们相加:

adView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

于 2013-08-30T21:44:52.880 回答