Take the 2-minute tour ×

i have a game developed in cocos2d in iphone ..i have getting adds from i ad and admob ... they are shown well in my app at the top ...

in my game my game score is shown at the tio .. when ad come its remian there for end of the game till thn game get over.. so i want that ad come and after 1 mint ad goes back with animation so user can see his score ...

i am usein g this code for getting adds

//////ADD WHIrl Code

pragma mark AdWhirlDelegate methods


  • (NSString *)adWhirlApplicationKey

    { //Here you have to enter your AdWhirl SDK key return @"XXXXXXXXXXXXXXXXXXXXXXXXXX"; }

  • (UIViewController *)viewControllerForPresentingModalView { //Remember that UIViewController we created in the Game.h file? AdMob will use it. //If you want to use "return self;" instead, AdMob will cancel the Ad requests. return viewController; }

-(void)adWhirlDidReceiveAd:(AdWhirlView *)adWhirlView { //This is a little trick I'm using... on my game I created a CCMenu with an image to promote //my own paid game so this way I can guarantee that there will always be an Ad on-screen //even if there's no internet connection... it's up to you if you want to implement this or not. //[self removeChild:adBanner cleanup:YES]; }

-(void)adWhirlDidFailToReceiveAd:(AdWhirlView *)adWhirlView usingBackup:(BOOL)yesOrNo { //The code to show my own Ad banner again }

-(void)onEnter { //Let's allocate the viewController (it will be used for the Ads) viewController = [UIViewController new]; //On our "onExit" method we are hidding the view so it doesn't show Ads in any other //scene but this one... it's needed to enable them [viewController.view setHidden:FALSE]; //This isn't really needed but also it makes no harm. It just retrieves the configuration //from adwhirl.com so it knows what Ad networks to use [adView updateAdWhirlConfig]; //Assign the AdWhirl Delegate to our adView self.adView = [AdWhirlView requestAdWhirlViewWithDelegate:self]; //This is required, even if you don't want to :P self.adView.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin;

self.adView.clipsToBounds = YES;
//Adding the adView (used for our Ads) to our viewController
[viewController.view addSubview:adView];
//Adding that viewController to our main view
[[[CCDirector sharedDirector] openGLView] addSubview:viewController.view];
[super onEnter];


-(void)onExit { //Set adView delegate to nil self.adView.delegate = nil; self.adView = nil; //Remove adView from superView
[adView removeFromSuperview]; //Release adView [adView release]; //Hide the viewController so there are no more Ads on screen in any scene but this one [viewController.view setHidden:TRUE]; [super onExit]; } */ /// End Add Whirl

thanks in advance Regards Haseeb

share|improve this question
I would guess you are going to have a hard time getting any useful replies if you cannot clean up your question. I can barely understand what you are trying to say. –  Michael Mar 19 '11 at 1:14
ADBannerView: ADBannerContentSizeIdentifier320x50 is deprecated, please use ADBannerContentSizeIdentifierPortrait instead.... getting this error –  Haseeb Warraich Apr 18 '11 at 6:45
add comment


Your Answer



Browse other questions tagged or ask your own question.