我试图在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
Enrico Susat.. 27
如果你和我一样愚蠢,别忘了添加AdSupport.framework
你的项目.
确保ASIdentifierManager.m
在"目标成员资格"下检查项目的目标.
如果你和我一样愚蠢,别忘了添加AdSupport.framework
你的项目.