繁体   English   中英

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

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

我按照他们网站上描述的方式将ASIHTTPRequest添加到了我的项目中。 现在我得到以下错误:

要点链接

我已经尝试读取框架MobileCoreServives,SystemConfiguration和CFNetwork和libz.dylib。 我还检查了多个类似主题的stackoverflow条目,但是问题仍然存在。

我使用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;
}

这与使用ARC有关。 您需要指定编译器标志,以不将ASIHTTP源编译为与ARC兼容。 选择您的项目,然后选择目标,然后转到“构建阶段”选项卡并打开“编译源”列表。 然后为每个与ASI相关的文件设置标志-fno-objc-arc。

在此处输入图片说明

暂无
暂无

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

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