2014-12-02 83 views
0

我试图把广告的介绍我的Xcode项目,但每次我运行该项目停止,我也得到了“线程1 SIGABRT错误”上说Xcode的6 - 线程1个SIGABRT错误

bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0, 20, 320, 50)]; 

这一部分的完整的代码 -

[super viewDidLoad]; 
    // Do any additional setup after loading the view, typically from a nib. 
    bannerView_ = [[GADBannerView alloc] initWithFrame:CGRectMake(0, 20, 320, 50)]; 
    bannerView_.adUnitID = @"ca-app-pub-1249154779941831/7243806389"; 
    bannerView_.rootViewController = self; 
    [self.view addSubview:bannerView_]; 
    [bannerView_ loadRequest:[GADRequest request]]; 
    SoundButton = [UIButton buttonWithType:UIButtonTypeCustom]; 

代码GADBannerview.h

// 
// GADBannerView.h 
// Google Mobile Ads SDK 
// 
// Copyright 2011 Google Inc. All rights reserved. 
// 

#import <UIKit/UIKit.h> 

#import "GADAdSize.h" 
#import "GADBannerViewDelegate.h" 
#import "GADInAppPurchaseDelegate.h" 
#import "GADModules.h" 
#import "GADRequest.h" 
#import "GADRequestError.h" 

@interface GADBannerView : UIView 

#pragma mark Initialization 

- (instancetype)initWithAdSize:(GADAdSize)adSize origin:(CGPoint)origin; 


- (instancetype)initWithAdSize:(GADAdSize)adSize; 

#pragma mark Pre-Request 


@property(nonatomic, copy) NSString *adUnitID; 

@property(nonatomic, weak) UIViewController *rootViewController; 


@property(nonatomic, assign) GADAdSize adSize; 

@property(nonatomic, weak) id<GADBannerViewDelegate> delegate; 


@property(nonatomic, weak) id<GADInAppPurchaseDelegate> inAppPurchaseDelegate; 

#pragma mark Making an Ad Request 

- (void)loadRequest:(GADRequest *)request; 

#pragma mark Ad Request 
@property(nonatomic, readonly, assign) BOOL hasAutoRefreshed; 

#pragma mark Mediation 

@property(nonatomic, readonly, weak) NSString *adNetworkClassName; 


@property(nonatomic, readonly, weak) UIView *mediatedAdView 
    __attribute__((deprecated("Use adNetworkClassName."))); 

@end 
+0

唯一的其他代码是 - GADBannerView * bannerView_;在我看来controller.h – 2014-12-02 19:50:34

+0

但你能在'GADBannerView.m'中显示一些代码吗?您的多线程标记也表明还有更多。也显示多线程部分。 – Unheilig 2014-12-02 19:52:29

+1

为什么用[swift]标记? – 2014-12-02 19:52:34

回答

1

请尝试设置“其他链接标志“与-ObjC -alll_load,它应该工作。

+0

你是如何从问题描述确定,这可能是一个问题? – Mrunal 2014-12-20 15:20:35

相关问题