我有通用二进制应用程序并开始使用Admob。 这是viewcontroller的代码。
横幅按预期显示,但当我点按横幅时,应用程序崩溃了。奇怪的是,它只发生在iPhone上。 iPad没问题。
bannerView_ = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerLandscape];
bannerView_.adUnitID = @"myid";
CGRect screen_size = [[UIScreen mainScreen] bounds];
bannerView_.frame = CGRectMake(0.0,
screen_size.size.width - bannerView_.bounds.size.height,
bannerView_.bounds.size.width,
bannerView_.bounds.size.height);
//2nd line, screen_size.size.width - bannerView_.bounds.size.height works good not screen_size.size.height - bannerView_.bounds.size.height
bannerView_.rootViewController = self;
[self.view addSubview:bannerView_];
[bannerView_ loadRequest:[GADRequest request]];
每当应用程序崩溃时,这是一个日志。
*** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'
*** First throw call stack:
(0x2ec82f0b 0x39415ce7 0x2ec82e4d 0x31523bf9 0x315238d1 0x3159b57d 0x3159a5f9 0xefc04 0x3144b361 0x2ec86454 0x2ebd09a7 0x398fed53 0x398fed3f 0x399016c3 0x2ec4d681 0x2ec4bf4d 0x2ebb6769 0x2ebb654b 0x33b136d3 0x31515891 0x1d5a9 0x39913ab7)
libc++abi.dylib: terminating with uncaught exception of type NSException
我想对此有任何想法或解决方案。提前谢谢。