我试图在我的应用程序的底部插入一个iad横幅,但在遵循教程后不断收到错误.
代码如下.
代码如下.
- @interface DMKHomeViewController (UIViewcontroller ) <ADBannerViewDelegate>{
- }
- @end
- @implementation DMKHomeViewController
- - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
- {
- self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
- if (self) {
- // Custom initialization
- }
- return self;
- }
- -(void)bannerViewDidLoadAd:(ADBannerView *)banner {
- [UIView beginAnimations:nil context:NULL];
- [UIView setAnimationDuration:1];
- [banner setAlpha:1];
- [UIView commitAnimations];
- }
- - (void)bannerView:(ADBannerView *)
- banner didFailToReceiveAdWithError:(NSError *)error
- {
- [UIView beginAnimations:nil context:NULL];
- [UIView setAnimationDuration:1];
- [banner setAlpha:0];
- [UIView commitAnimations];
- }
我一直收到以下错误
*由于未捕获的异常’NSInvalidUnarchiveOperationException’终止应用程序,原因:’无法实例化名为ADBannerView的类’
*第一次抛出调用堆栈:
解决方法
请确保您已添加“iAd.framework”…
要执行此操作,请转到“App.Target”,“General”并向下滚动,直到您看到“Linked Frameworks and Libraries”.点击“”并选择iAd框架.请参阅下面的屏幕截图…