Ios 实现AdMob SDK-iPhone

Ios 实现AdMob SDK-iPhone,ios,objective-c,iphone,xcode,Ios,Objective C,Iphone,Xcode,我正在尝试实现AdMob SDK,但当我在viewDidLoad方法中运行以下代码时,会收到这些错误和警告 // 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]

我正在尝试实现AdMob SDK,但当我在viewDidLoad方法中运行以下代码时,会收到这些错误和警告

// 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]];
以下是我收到的错误和警告。。。怎么了

这里还有我的项目导航器中的AdMob文件

编辑:我现在在应用程序启动时收到此崩溃

'NSInvalidArgumentException', reason: '-[GADBannerView private]: unrecognized selector sent to instance 

我能想到的第一件事是转到项目中的buildphases选项卡,并选中linkbinary With Libraries框。查看是否有您的“libgogleadmobads.a”。

将-all\u load标志添加到“其他链接器标志”中,它应该可以工作。

现在我遇到了这个崩溃…'NSInvalidArgumentException',原因:'-[GadbanerView private]:未识别的选择器发送到实例,然后添加它。单击+按钮并将其放在那里。让我知道这是否有效。我看到人们也遇到了这个问题。答案是在页面底部的链接器设置中,不要使用-all_load而是-ObjC。