iOS _OBJC_CLASS_$_ASIdentifierManage 引用自:ViewController.o 中的 objc-class-ref

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20363977/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 22:36:22  来源:igfitidea点击:

iOS _OBJC_CLASS_$_ASIdentifierManage referenced from: objc-class-ref in ViewController.o

ioslinker-errors

提问by Cyph

I am trying to launch a WebView in iOS and transmit the IDFA as part of a GET request but when I try to build it fails and I get the following error:

我正在尝试在 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)

Here is the code I have. Any idea what I'm doing wrong here, I am a bit stuck

这是我的代码。知道我在这里做错了什么,我有点卡住了

    #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

回答by Enrico Susatyo

In case you are as stupid as me, don't forget to add AdSupport.frameworkin your project too.

如果你和我一样愚蠢,也不要忘记添加AdSupport.framework到你的项目中。

回答by rmaddy

Make sure ASIdentifierManager.mis checked under "Target Membership" for your project's target.

确保ASIdentifierManager.m在您的项目目标的“目标成员资格”下选中。