是否可以在TodayExtension中使用AFNetworking?

时间:2016-02-17 15:19:22

标签: ios afnetworking nsurlsession today-extension

我在iOS应用程序中使用AFNetworking没有任何问题。但现在,我需要从我的TodayExtension对我的后端执行一些API调用。

当我尝试向我的TodayExtension目标添加任何类型的AFNetworking类时,编译器崩溃。

Undefined symbols for architecture armv7:
  "_AFNetworkingErrorDomain", referenced from:
      -[AFHTTPRequestOperation error] in AFHTTPRequestOperation.o
  "_AFNetworkingOperationFailingURLResponseErrorKey", referenced from:
      -[AFHTTPRequestOperation error] in AFHTTPRequestOperation.o
  "_AFNetworkingOperationFailingURLRequestErrorKey", referenced from:
      -[AFHTTPRequestOperation error] in AFHTTPRequestOperation.o
  "_OBJC_METACLASS_$_AFURLConnectionOperation", referenced from:
      _OBJC_METACLASS_$_AFHTTPRequestOperation in AFHTTPRequestOperation.o
  "_OBJC_CLASS_$_AFURLConnectionOperation", referenced from:
      _OBJC_CLASS_$_AFHTTPRequestOperation in AFHTTPRequestOperation.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)

有没有办法使用它?从TodayExtension调用我的API的最佳方法是什么?也许使用NSURLSession

0 个答案:

没有答案