在OS X 10.8上使用AFNetworking 2.0+

时间:2014-03-23 14:45:05

标签: afnetworking-2

是否有人在OS X 10.8上成功使用AFNetworking 2. *?它的文档说最低要求是OS X 10.8但我没有运气在部署目标和Base SDK 10.8的应用程序中使用它。

我收到以下错误:

Undefined symbols for architecture x86_64:
  "_NSURLSessionTransferSizeUnknown", referenced from:
      -[AFURLSessionManagerTaskDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:] in libPods.a(AFURLSessionManager.o)
      -[AFURLSessionManager uploadTaskWithTask:progress:completionHandler:] in libPods.a(AFURLSessionManager.o)
  "_OBJC_CLASS_$_NSURLSession", referenced from:
      objc-class-ref in libPods.a(AFURLSessionManager.o)
  "_OBJC_CLASS_$_NSURLSessionConfiguration", referenced from:
      objc-class-ref in libPods.a(AFHTTPSessionManager.o)
      objc-class-ref in libPods.a(AFURLSessionManager.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

是否可以在OS X 10.8上使用AFNetworking 2?

1 个答案:

答案 0 :(得分:1)

AFNetworking 2.0可以在OSX 10.8上使用,但您无法使用基于NSURLSession的类(可从10.9获取)基本上不使用{{1}甚至是AFURLSessionManager & AFHTTPSessionManager中定义的常量。

使用以下:

NSURLSession