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
唯一的其他代碼是 - GADBannerView * bannerView_;在我看來controller.h – 2014-12-02 19:50:34
但你能在'GADBannerView.m'中顯示一些代碼嗎?您的多線程標記也表明還有更多。也顯示多線程部分。 – Unheilig 2014-12-02 19:52:29
爲什麼用[swift]標記? – 2014-12-02 19:52:34