我正在尝试在iOS中启动WebView并将IDFA作为GET请求的一部分进行传输,但是当我尝试构建它失败时,我收到以下错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ASIdentifierManager", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这是我的代码。知道我在这里做错了什么,我有点卡住了
#import "ViewController.h"
#import "AdSupport/ASIdentifierManager.h"
@interface ViewController ()
@end
@implementation ViewController
@synthesize webView;
- (void)viewDidLoad
{
NSString *idfaString = [[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString];
webView.backgroundColor = [UIColor blueColor];
NSURL *url = [NSURL URLWithString:@"http://example.com/"];
NSString *param = [url.path stringByAppendingString: idfaString];
NSURL *send = [[NSURL alloc] initWithString:param];
NSURLRequest *req = [NSURLRequest requestWithURL:send];
[webView loadRequest:req];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
答案 0 :(得分:25)
如果您和我一样愚蠢,请不要忘记在项目中添加AdSupport.framework
。
答案 1 :(得分:21)
确保在项目目标的“目标成员资格”下选中ASIdentifierManager.m
。