当我将AdMobSDK添加到Xcode项目时,
Apple Mach-O Linker error
发生。
我有这段代码。
MainViewController.m
#define BANNER_UNIT_ID @"ca-app-pub-79429573xxxxxxxx/78xxxxxxxx"
@interface MainViewController ()
@property (nonatomic) GADBannerView* bannerView_;
@property (nonatomic, strong) UIView *myView;
@end
@implementation MainViewController
@synthesize myView;
- (void)viewDidLoad
{
[super viewDidLoad];
[self setUpMyView];
}
- (void)setUpMyView
{
myView = [[UIView alloc]initWithFrame:CGRectMake(0, 60, 320, 508)];
myView.opaque = NO;
myView.backgroundColor = [UIColor colorWithWhite:1.0f alpha:0.0f];
[self.view addSubview:myView];
self.bannerView_ = [[GADBannerView alloc]initWithAdSize:kGADAdSizeBanner];
self.bannerView_.adUnitID = BANNER_UNIT_ID;
self.bannerView_.rootViewController = self;
[myView addSubview:self.bannerView_];
[self.bannerView_ loadRequest:[GADRequest request]];
}
我添加了以下框架
AdSupport
AudioToolbox
AVFoundation
CoreGraphics在
MessageUI
StoreKit
SystemConfiguration
然后发生以下错误。
Apple Mach-O Linker error:
"_OBJC_CLASS_$_CTTelephonyNetworkInfo", referenced from:
linker command failed with exit code 1 (use -v to see invocation)
我该如何解决?
谢谢。
答案 0 :(得分:1)
您尚未在Admob要求的应用程序中包含CoreTelephony框架。该文档提供了有关如何执行此操作的信息。