ios - 添加 AFNetworking 后 APPLE MACH-O LINKED ERROR

标签 ios afnetworking linker-errors mach-o

只是将 AFNetworking 添加到我的项目中,在 B&R 之后我得到了这样的错误:

Undefined symbols for architecture i386:
"_SecCertificateCopyData", referenced from:
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in       AFURLConnectionOperation.o
"_SecCertificateCreateWithData", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in  AFURLConnectionOperation.o
"_SecPolicyCreateBasicX509", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustCopyPublicKey", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustCreateWithCertificates", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustEvaluate", referenced from:
  ___44+[AFURLConnectionOperation pinnedPublicKeys]_block_invoke in AFURLConnectionOperation.o
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustGetCertificateAtIndex", referenced from:
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
"_SecTrustGetCertificateCount", referenced from:
  -[AFURLConnectionOperation connection:willSendRequestForAuthenticationChallenge:] in AFURLConnectionOperation.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

已经检查过framework,libs和编译源,或者重新添加AFURLConnection.m,也不行。

谁能帮帮我? 非常感谢...

最佳答案

您需要添加 Security.framework 才能构建它。

关于ios - 添加 AFNetworking 后 APPLE MACH-O LINKED ERROR,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18021362/

相关文章:

ios - UITextView 观察文字变化

ios - 我如何在 iOS 上使用 CoreGraphics 渲染的 pdf 上反转文本颜色?

c++ - Xcode 链接器错误 : linker command failed with exit code 1 (use -v to see invocation)

c++ - 使用 Microsoft Visual C++ 6.0 解决 __imp__open 和其他类似命名函数的链接错误

ios - Google Consent SDK - 链接器错误

ios - 如何使 NSCalendar 周从星期一而不是星期日开始

ios - MIDINetworkConnection EXC_BAD_ACCESS 错误

ios - 如何使用 AFNetworking 比较 SSL 证书

objective-c - 将来自 AFHTTPRequestOperation 的响应传递给 UIWebview

ios - 在 POST 请求中发送 JSON 对象 AFNetworking , iOS