【问题标题】:AFNetworking error - AFHTTPRequestOperationManager (symbols not found for architecture x86_64)AFNetworking 错误 - AFHTTPRequestOperationManager(未找到架构 x86_64 的符号)
【发布时间】:2015-09-27 16:39:47
【问题描述】:

我正在我的应用程序中实现 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】:

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

    [!] 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 添加了所需的标志,问题就为我解决了。

    【讨论】:

      猜你喜欢
      • 2015-10-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-21
      • 1970-01-01
      • 2015-12-16
      • 2015-05-31
      • 2023-03-05
      相关资源
      最近更新 更多