使用 Cocoapods 安装 AFNetworking 后未定义的符号

Undefined symbols after installing AFNetworking with Cocoapods

谁能帮我解决这个问题,这让我发疯。我查看了所有我能找到的具有类似问题的 post,并且 none 有效。

我使用 Cocoapods 在我的项目中安装了 AFNetworking 3.0,安装后,我在我的项目中看到了 AFNetworking pod。每当我尝试构建时,我都会收到以下错误:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_AFHTTPSessionManager", referenced from:
      objc-class-ref in Server.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我进一步调查后解决了问题。

我在Project->Build Phases->Link Binary With Librarys

中添加了libAFNetworking.a

现在编译正确。