我在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
?