Reputation: 1462
I'm trying to implement the AdMob SDK, but I get these errors and warnings when I run the following code in my viewDidLoad method...
// Create a view of the standard size at the bottom of the screen.
// Available AdSize constants are explained in GADAdSize.h.
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner];
// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = @"a15030fff8e7e98";
// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:[GADRequest request]];
Here are the errors and warnings that I receive... What is wrong?
Also here are the AdMob files in my Project Navigator...
EDIT: I now receive this crash when my app starts...
'NSInvalidArgumentException', reason: '-[GADBannerView private]: unrecognized selector sent to instance
Upvotes: 0
Views: 554
Reputation: 390
Add the -all_load flag to "Other Linker Flags" and it should work.
Upvotes: 1
Reputation: 145
First thing I can think of is to go to the Build Phases tab in your Project and check the Link Binary With Libraries box. See if your "libGoogleAdMobAds.a" is there.
Upvotes: 0