I'm using AdMob 6.2.1 in my app which runs under iOS 6 only. I've followed google instructions and everything is working well when running on the simulator and on my iPhone 5.
But, when submitting to Apple the app, i get it refused and the crash log indicates the following:
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)
I don't understand why it is working for me and crashing with Apple staff.
I had added -ObjC
(both to Debug and Release) to Other Linker Flags
in Build Settings
.
Here is the block code where the crash occurs:
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];
Thank you all for your help.