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

时间:2015-09-27 16:39:47

标签: objective-c iphone afnetworking-2

我正在申请中实施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"

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

任何帮助都会很明显。

1 个答案:

答案 0 :(得分: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添加了必需的标志,问题就解决了。