Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not instantiate class named ADBannerView

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];

}

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

like image 355
MikeAsp Avatar asked Jun 06 '14 12:06

MikeAsp


1 Answers

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

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...

App. Target -> General

'+' to add, search for iAd

like image 129
serge-k Avatar answered Sep 21 '22 08:09

serge-k