简体   繁体   English

如何从iOS中的服务器接收二进制列表

[英]How to receive list of binaries from server in iOS

In my iOS app, I am trying to get a list of serialized objects from an HTTP server. 在我的iOS应用中,我试图从HTTP服务器获取序列化对象的列表。

Which Apple API should I choose to get the binary from server? 我应该选择哪个Apple API从服务器获取二进制文件? I have read about NSURLSession, NSURLConnection, and others, but not sure which one to choose. 我已经阅读了有关NSURLSession,NSURLConnection和其他内容的信息,但不确定要选择哪一个。

Both will do. 两者都会做。 NSURLSession is much more powerful tool than NSURLConnection. NSURLSession比NSURLConnection更强大。 If your task is simple - use NSURLConnection. 如果您的任务很简单-请使用NSURLConnection。 If you need all that fine features of NSURLSession - go for it. 如果您需要NSURLSession的所有出色功能-那就去吧。

There's a great tutorial on using NSURLSession NSURLSession tutorial . 关于使用NSURLSession NSURLSession教程,有很棒的教程 It also states diff between both tools 它还指出了两种工具之间的差异

Also, take a look at AFNetworking framework - makes everything much easier 另外,看看AFNetworking框架-使一切变得更加容易

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM