简体   繁体   English

在我的项目中实施iAd时遇到问题

[英]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. 我正在为我的项目实施iAd,但是当我将iAdd添加到播放列表页面时会出现问题。然后显示iAdd的演示版本,但是当我单击该图像时它不会打开整个页面。但是当我尝试清空xib时它将打开整个页面。现在,我将告诉我在我的应用中使用的连接和代码的整个过程。

For connection : addbanner is connect to fileowner & file owner is connect to view and addbanner. 对于连接:addbanner连接到文件所有者,文件所有者连接到视图和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 现在我正在使用滚动视图到播放列表页面,在其中向其中添加iad以及我已按照以下方式使用的代码

-(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. 请帮助我解决此错误。

It's a simple error. 这是一个简单的错误。 You accidentally misspelled moveBannerViewOffScreen as mov BannerViewOffscreen in the bannerDidFailToRecieveAdWithError() method. 您不小心将moveBannerViewOffScreen拼写为bannerDidFailToRecieveAdWithError()方法中的mov BannerViewOffscreen。

It's here: 它在这里:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM