我在仅在 iOS 6 下运行的应用中使用 AdMob 6.2.1。我已经按照谷歌的说明在模拟器和我的 iPhone 5 上运行时一切正常。
但是,当向 Apple 提交应用程序时,我被拒绝了,并且崩溃日志显示以下内容:
Last Exception Backtrace:
0 CoreFoundation 0x3abcb3e2 __exceptionPreprocess + 158
1 libobjc.A.dylib 0x392d695e objc_exception_throw + 26
2 CoreFoundation 0x3abcef2c -[NSObject(NSObject) doesNotRecognizeSelector:] + 180
3 CoreFoundation 0x3abcd648 ___forwarding___ + 388
4 CoreFoundation 0x3ab25204 _CF_forwarding_prep_0 + 20
5 Dus 0x000d39f4 -[GADObjectPrivate loadPrivateRequest:autoRefresh:] (GADObjectPrivate.m:402)
6 Dus 0x000d5454 -[GADObjectPrivate loadRequest:] (GADObjectPrivate.m:827)
7 Dus 0x000d2f20 -[GADBannerView loadRequest:] (GADBannerView.m:271)
8 Dus 0x000b57cc -[DMViewController viewDidLoad] (DMViewController.m:131)
我不明白为什么它对我有用并且会与 Apple 员工发生冲突。
我已将-ObjC
(调试和发布)添加Other Linker Flags
到Build Settings
.
这是发生崩溃的块代码:
bannerView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner origin:origin];
bannerView.adUnitID = @"MYBANNERID";
[bannerView setRootViewController:self];
[bannerView setDelegate:self];
bannerView.center = CGPointMake(self.view.center.x, bannerView.center.y);
GADRequest *request = [GADRequest request];
[bannerView loadRequest:request]; //CRASHES HERE
[self.view addSubview:bannerView];
谢谢大家的帮助。