简体   繁体   English

XCode iOS ASIHTTPRequest:“ Apple Mach-O链接器(Id)错误”

[英]XCode iOS ASIHTTPRequest: “Apple Mach-O Linker (Id) Error”

I added ASIHTTPRequest to my project in the way it is described on their site . 我按照他们网站上描述的方式将ASIHTTPRequest添加到了我的项目中。 Now I get the following errors: 现在我得到以下错误:

Gist-Link 要点链接

I already tried readdding the frameworks MobileCoreServives, SystemConfiguration and CFNetwork and libz.dylib. 我已经尝试读取框架MobileCoreServives,SystemConfiguration和CFNetwork和libz.dylib。 I also checked multiple stackoverflow entries to similar topics, but the problem still exists. 我还检查了多个类似主题的stackoverflow条目,但是问题仍然存在。

The function where I use the ASIHTTPRequest is the following: 我使用ASIHTTPRequest的函数如下:

NSString* getHTMLResponse(){
    //Do request
    NSString *urlString = [[NSString alloc] initWithString:@"http://google.com"];
    urlString = [urlString stringByAppendingString:ean];
    NSURL *url = [NSURL URLWithString:urlString];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    [request startSynchronous];
    NSError *error = [request error];
    NSString *response = [[NSString alloc] init];
    if (!error) {
        response = [request responseString];
    }
    return response;
}

This is related to using ARC. 这与使用ARC有关。 You need to specify compiler flags to not to compile ASIHTTP sources as ARC compatible. 您需要指定编译器标志,以不将ASIHTTP源编译为与ARC兼容。 Select your project, then target, then go to Build Phases tab and open the "Compile Sources" list. 选择您的项目,然后选择目标,然后转到“构建阶段”选项卡并打开“编译源”列表。 Then for each ASI related file set the flag -fno-objc-arc. 然后为每个与ASI相关的文件设置标志-fno-objc-arc。

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM