gpt4 book ai didi

ios - 应用崩溃 +[NSDecimalNumber gad_negativeOne] : issue?

转载 作者:可可西里 更新时间:2023-11-01 05:00:42 26 4
gpt4 key购买 nike

我的应用程序之前运行良好,然后我添加了 admob 框架,现在它崩溃了。

请检查崩溃日志,

enter image description here

我已经在谷歌上尝试过,但没有关于这次崩溃的结果。

如果我在 viewDidAppear() 中评论了内容,那么应用程序正在运行(不加载应用程序部分)。但是,如果我试图加载“admob”,那么它就会崩溃。


代码:

-(void)viewDidAppear:(BOOL)animated{
if([Connectivity hasConnectivity]){
// [self loadAds];
NSTimer* myTimer = [NSTimer scheduledTimerWithTimeInterval: 15.0 target: self
selector: @selector(callAfterSixtySecond:) userInfo: nil repeats: YES];
}
}
-(void) callAfterSixtySecond:(NSTimer*) t
{

if([GMMConnectivity hasConnectivity]){

[self.adBanner removeFromSuperview];
[self loadAdmob];
}
}

-(void)loadAdmob{

CGPoint origin;
if(IS_RETINA){
if([[UIScreen mainScreen] bounds].size.height >500){
// NSLog(@"5");
origin = CGPointMake(0.0,
568-
CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
}else{
// NSLog(@"4");

origin = CGPointMake(0.0,
(480)-
CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);
}
}else{
// NSLog(@"3");

origin = CGPointMake(0.0,
(460)-
CGSizeFromGADAdSize(kGADAdSizeSmartBannerPortrait).height);

}
// Use predefined GADAdSize constants to define the GADBannerView.
self.adBanner = [[GADBannerView alloc] initWithAdSize:kGADAdSizeSmartBannerPortrait
origin:origin]
;

// Note: Edit SampleConstants.h to provide a definition for kSampleAdUnitID
// before compiling.
self.adBanner.adUnitID = MY_BANNER_UNIT_ID;
self.adBanner.delegate = self;
[self.adBanner setRootViewController:self];
[self.view addSubview:self.adBanner];
self.adBanner.center =
CGPointMake(self.view.center.x, self.adBanner.center.y);
[self.adBanner loadRequest:[self createRequest]];
[self.view addSubview:adBanner_];
}

最佳答案

您需要将“-ObjC”添加到Build Settings 选项卡的Other Linker Flags。祝你好运!

关于ios - 应用崩溃 +[NSDecimalNumber gad_negativeOne] : issue?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23853709/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com