没有已知的选择器'setAutoresizingMask'类

时间:2013-08-30 21:38:24

标签: iphone objective-c iad

这是我尝试放入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.
}

1 个答案:

答案 0 :(得分:0)

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

adView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

如果您需要多个,请使用按位或运算符将它们添加到一起:

adView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;