1
我遇到Admob旗幟顯示的問題,但是,當您點擊它時,它會崩潰應用程序,或者什麼也不做。Admob&Cocos2d - admob無法點擊 - 查看不到層級結構
它是利用AdMob中介,分裂與IAD,如果iAd的顯示器,它可以挖掘沒有問題... ...
- (void) onEnter {
if (![MKStoreManager featureAPurchased])
{
controller = [[RootViewController alloc]init];
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait];
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
CGFloat screenHeight = screenRect.size.height;
CGFloat screenXPos = (screenWidth /2);
CGFloat screenYPos = screenHeight - 25;
[bannerView_ setCenter:CGPointMake(screenXPos, screenYPos)];
bannerView_.rootViewController = controller;
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
bannerView_.rootViewController = controller;
[[[CCDirector sharedDirector]view] addSubview: bannerView_];
[bannerView_ loadRequest:[GADRequest request]];
}else{
bannerView_.hidden = YES;
}
的錯誤是,如果我試圖挖掘一條橫幅什麼也沒有發生,而在控制檯我看到以下錯誤;
Attempt to present <GADBrowserController: 0x1d576ca0> on <RootViewController: 0x1e8ed3f0> whose view is not in the window hierarchy!
希望得到任何援助
嗨Skytz,我會把該代碼放在哪裏?我需要在其他地方聲明任何變量嗎? – user1695971
其他人可以幫忙嗎? – user1695971
@ user1695971只是複製和粘貼我編寫的函數,而不是你編寫的函數 – skytz