user313396
user313396

Reputation: 239

problem with implementing iAd to my project

I am implementing iAd to my project But the problem arises when i will included iAdd to my playlist page .then demo version of iAdd is shown but when i click that image it will not open the whole page.Butwhen i will try to empty xib then it will open the whole page.now i will tell the whole process of connection and code which i used in my app.

For connection : addbanner is connect to fileowner & file owner is connect to view and addbanner.

Now i am using scroll view to playlistpage in which i add iad to it and the code which i have used as follow

-(BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner
{
    [self moveBannerViewOnscreen];
}

-(void)moveBannerViewOffscreen
{
    //CGRect originalScrollFrame =self.scrollView.frame;
    //CGFloat newScrollHeight =self.view.frame.size.height;
    //CGRect newScrollFrame =originalScrollFrame;
    //newScrollFrame.size.height =newScrollHeight;
    CGRect newBannerFrame =self.bannerView.frame;
    //newBannerFrame.origin.y =newBannerHeight;
    //self.scrollView.frame =newScrollFrame;
    self.bannerView.frame =newBannerFrame;
}

-(void)moveBannerViewOnscreen
{
    CGRect newBannerFrame =self.bannerView.frame;
    newBannerFrame.origin.y =self.view.frame.size.height -newBannerFrame.size.height;

    //CGRect originalScrollFrame =self.view.frame.size.height - newBannerFrame.size.height;
    //CGRect originalScrollFrame =self.scrollView.frame;
    //CGRect newScrollHeight =newBannerFrame.size.height - self.view.frame.size.height;
    //CGRect newScrollFrame =originalScrollFrame;
    //newScrollFrame.size.height =newScrollHeight;

    [UIView beginAnimations:@"BannerViewIntro" context :NULL];
    self.bannerView.frame=newBannerFrame;
    [UIView commitAnimations];
}

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
    [self movBannerViewOffscreen];
}

-(void)bannerViewDidLoadAd:(ADBannerView *)banner
{
    [self moveBannerViewOnscreen];
}

-(BOOL)bannerViewActionDidFinish:(ADBannerView *)banner
{
//[Abtsk startAUGraph];
}

sample for scroll button alsoeven i attach

b1 = [[UIButton alloc] initWithFrame:CGRectMake(0, 15, 320, 85)];    
[b1 setBackgroundImage:[UIImage imageNamed:@"1.jpg"] forState:UIControlStateNormal];
[b1 addTarget:self action:@selector(buttonPressed1:) forControlEvents: UIControlEventTouchUpInside];      
[views addSubview:b1];
[b1 release];

please help me to solve this error.

Upvotes: 0

Views: 327

Answers (1)

SeniorShizzle
SeniorShizzle

Reputation: 984

It's a simple error. You accidentally misspelled moveBannerViewOffScreen as movBannerViewOffscreen in the bannerDidFailToRecieveAdWithError() method.

It's here:

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error
{
    [self movBannerViewOffscreen];
}

Upvotes: 3

Related Questions