AFNetworking错误-AFHTTPRequestOperationManager(未找到架构x86_64的符号)

问题描述 投票:1回答:1

我正在我的应用程序中实现AFNetworking。

我已在我的应用程序中成功导入文件夹AFNetworking和UIKit + AFNetworking。我的代码如下。

#import "AFNetworking/AFHTTPRequestOperationManager.h"


- (void)viewDidLoad {
    [super viewDidLoad];

    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    NSDictionary *parameters = @{@"foo": @"bar"};
    [manager POST:@"http://example.com/resources.json" parameters:parameters success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"JSON: %@", responseObject);
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error: %@", error);
    }];
    // Do any additional setup after loading the view, typically from a nib.
}

上面的代码不是实际的代码,而只是检查一切是否正常工作,但是在这里我得到了错误:

找不到体系结构x86_64的符号

我引用了Stack Overflow的几个链接,但无法解决问题。

objective-c iphone afnetworking-2
1个回答
0
投票

我遇到了同样的问题,问题是目标的其他链接标志字段

[!] The `SPEEPHOTAG [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `SPEEPHOTAG [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[当我将$(inherited)写入其他链接标志时,它为AFNetworking添加了必需的标志并且问题已为我解决。

© www.soinside.com 2019 - 2024. All rights reserved.