无法实例化名为ADBannerView的类 [英] Could not instantiate class named ADBannerView

查看:110
本文介绍了无法实例化名为ADBannerView的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的应用程序底部插入一个iad横幅,但在按照教程进行操作后仍然会出现错误。
代码如下。

i am trying to inset an iad banner at the bottom of my app but keep getting errors after following tutorials. code as follows.

@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的类'
*
首先抛出调用堆栈:

i keep getting the following error * Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named ADBannerView' * First throw call stack:

推荐答案

请确保您已添加 iAd.framework ...

Please make sure that you have added the "iAd.framework"...

为此,请转到应用目标,常规并向下滚动,直到看到链接的框架和库。点击 +,然后选择iAd框架。请参见下面的屏幕截图...

To do this go to the "App. Target", "General" and scroll down until you see "Linked Frameworks and Libraries". Hit "+" and select the iAd framework. See screen captures below...

这篇关于无法实例化名为ADBannerView的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆