1

So I am trying to have multiple(five actually)iAd banners in one view controller, and have them animate up from the bottom in succession as they each receive an add. I am trying to figure out the best way to implement this. Since they are all in one view controller, I have the delegate for each set to self, so they all call - (void)bannerViewDidLoadAd:(ADBannerView *)banner

and I have worked with iAds before, and with only one banner, I usually offset it from the bottom of the screen and then do this

-(void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error

{

 if (self.bannerIsVisible)
{

    [UIView beginAnimations:@"animateAdBannerOff" context:NULL];
    //Assumes the banner view is placed at the bottom of the screen.
    banner.frame = CGRectOffset(banner.frame, 0, banner.frame.size.height);
    [UIView commitAnimations];
    self.bannerIsVisible = NO;


   }
}

but obviously banner cannot refer to all the banners at the same time,so how would I do this? Could I just use the property for each of them in this same way? I did try that, but it did not seem to be working.

And also, this is for a joke, and my personal desire to figure this out, in case you are wondering why I want five ad banners on one view.

Thanks!

4

1 に答える 1

1

同じデリゲートを指す複数の iAd インスタンスを持つことは、フレームワークの観点から禁止されている可能性があるため、表示する iAd ごとに iAd デリゲート メソッドを実装する単一のビュー コントローラーを作成し、各ビュー コントローラーを追加するだけでよい場合があります。 subView をすべての広告を表示しているメイン ビューに移動します。

于 2012-12-05T01:57:34.280 に答える