AFNetworking 错误 - AFHTTPRequestOperationManager(未找到架构 x86_64 的符号)
Posted
技术标签:
【中文标题】AFNetworking 错误 - AFHTTPRequestOperationManager(未找到架构 x86_64 的符号)【英文标题】:AFNetworking error - AFHTTPRequestOperationManager (symbols not found for architecture 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 的几个链接,但我无法解决问题。
【问题讨论】:
【参考方案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
添加了所需的标志,问题就为我解决了。
【讨论】:
以上是关于AFNetworking 错误 - AFHTTPRequestOperationManager(未找到架构 x86_64 的符号)的主要内容,如果未能解决你的问题,请参考以下文章