我試圖導入AdMob SDK,但是當我在viewDidLoad方法運行下面的代碼我得到這些錯誤和警告......實施AdMob廣告SDK - iPhone
// 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]];
這裏有錯誤和我收到的警告......什麼是錯的?
而且,這裏是我的Project Navigator中的AdMob文件...
編輯:我的應用程序啓動時,我現在收到此崩潰...
'NSInvalidArgumentException', reason: '-[GADBannerView private]: unrecognized selector sent to instance
不,它不在那裏。 –
現在我得到這個崩潰,雖然...'NSInvalidArgumentException',原因:' - [GADBannerView私人]:無法識別的選擇發送到實例 –
然後添加它。點擊+按鈕放在那裏。讓我知道這是否有效。 –