NthDegree
NthDegree

Reputation: 1341

XCode iOS ASIHTTPRequest: "Apple Mach-O Linker (Id) Error"

I added ASIHTTPRequest to my project in the way it is described on their site. Now I get the following errors:

Gist-Link

I already tried readdding the frameworks MobileCoreServives, SystemConfiguration and CFNetwork and libz.dylib. I also checked multiple stackoverflow entries to similar topics, but the problem still exists.

The function where I use the ASIHTTPRequest is the following:

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;
}

Upvotes: 1

Views: 1340

Answers (1)

Eugene
Eugene

Reputation: 10045

This is related to using ARC. You need to specify compiler flags to not to compile ASIHTTP sources as ARC compatible. 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.

enter image description here

Upvotes: 1

Related Questions