les bannières, j'ai les suivantesComment afficher et masquer les bannières publicitaires dans le jeu en classe? Pour importer
#import "RootViewController.h"
#import "cocos2d.h"
#import "platform/ios/CCEAGLView-ios.h"
#import <iAd/iAd.h>
@interface RootViewController()
@end
@implementation RootViewController
Pour afficher les bannières publicitaires que je donne les résultats suivants dans mon RootViewController.mm:
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
ADBannerView *adView = [[ADBannerView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 50, 320, 50)];
[self.view addSubview:adView];
}
Le problème est dans mon jeu, l'annonce montre tout au long du jeu, et je veux juste que la bannière apparaisse une fois le gameover.cpp initialisé. Comment ferais-je cela? La classe GameOver est en C++ et le RootViewController est en Obj C.