Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

<Google> Must set the rootViewController property of GADBannerView before calling loadRequest:

I use Google AdMob SDK in my iPhone app, I did set the rootViewController property, delegate property

self.adBannerView.rootViewController = basedViewController;
self.adBannerView.delegate = basedViewController;
[self.adBannerView loadRequest:[GADRequest request]];

but keep getting this message while running the app:

<Google> Must set the rootViewController property of GADBannerView before calling loadRequest:

I manage 3 GADBannerView at the same time, do you know the status of GADBannerView (does it have rootViewController set or not) while debugging the app?

like image 498
Tuyen Nguyen Avatar asked Jul 20 '11 21:07

Tuyen Nguyen


2 Answers

I think the basedViewController is not created yet. Step 1) Create the viewcontroler Step 2) Assign

like image 169
Cape Avatar answered Oct 27 '22 09:10

Cape


Use your code at end of View Did Load on your viewcontroller.m

like image 28
abdul sathar Avatar answered Oct 27 '22 09:10

abdul sathar