AFNetworking Library failing in iOS 7

泪湿孤枕 提交于 2019-12-10 18:54:07

问题


Using the new iOS 7 Beta and downloading the latest version of AFNetworking, I went to File>Add Files to Project, and passed in the directory AFNetworking.framework. Now I'm getting a slew of linker errors. For a sanity check, I rolled back the commit history to iOS 6 and everything compiled successfully. Here's the log:

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

Do I need to wait for AFNetworking to get up-to-date with the next version of iOS or is this an architecture issue?

Thanks


回答1:


AFNetworking compiles and loads fine for me on iOS 7. The easiest solution would be for you to set up CocoaPods, and include AFNetworking that way.

See this answer for instructions on making sure the file is included in your target. This answer will explain all the pieces of the error message to you.

iOS 7 is probably a red herring, but if AFNetworking was working before (you didn't say), you may want to file a bug report if your libraries got unlinked when you upgraded.



来源:https://stackoverflow.com/questions/17053434/afnetworking-library-failing-in-ios-7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!