0

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]];

表示されるエラーと警告は次のとおりです...何が問題なのですか?

xCode

Project Navigator の AdMob ファイルもここにあります...

ここに画像の説明を入力

編集:アプリの起動時にこのクラッシュが発生するようになりました...

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

2 に答える 2

1

-all_load フラグを「Other Linker Flags」に追加すると、機能するはずです。

于 2012-09-21T20:51:54.220 に答える
0

まず考えられるのは、プロジェクトの [ビルド フェーズ] タブに移動し、[ライブラリとバイナリをリンク] ボックスをオンにすることです。「libGoogleAdMobAds.a」があるかどうかを確認します。

于 2012-09-01T15:09:44.713 に答える