从 iOS 应用程序登录服务器并与其通信...帮助!
嘿大家。我在开发 iOS 应用程序方面拥有相当多的经验,但在 Web/服务器交互应用程序方面却没什么经验。对于工作中的一个项目,我正在制作一个应用程序,它可以让您登录并从服务器获取照片,然后下载这些照片以在本地设备上显示和查看。
我需要获得一些有关正确方法的指导。是否有内置的类可以让做这样的事情变得容易?一旦从服务器下载了令人信服的内容,它将在本地查看,所以我所需要的只是获得一个正确的方向,以便从 iPhone 登录并与服务器通信。
有人能指出我正确的方向吗?
Hey everyone. I have a fair amount of experience developing iOS apps, but nothing much with web/server interacting apps. For a project at work, I am making an app that will let you login, and get pictures off from a server that will then be downloaded for display and review on the local device.
I need to get some pointers on the correct approach to take. Are there built-in classes that make doing something like this easy? Once the cogent is downloaded from the server, it will be viewed locally, so all I need is to get a point in the right direction for logging in and communicating with a server…from an iPhone.
Can anybody point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我,我使用 ASIHTTPRequest Librayry 与互联网通信/下载。
例如,对于新闻应用程序,我下载 JSON 格式的最新新闻(使用 Web 服务器上的 PHP 脚本)并使用 SQLite 存储数据。如果您需要有关 iPhone 的 JSON 的一些解释,请查看此处< /a> (法语,但源代码是英语^^)
当我需要下载图像时,我使用 ASIHTTPRequest 和队列来避免同时下载很多文件。
如果您想了解有关某个步骤的更多信息,请直接说出来。
祝你好运 !
Me, I'm using ASIHTTPRequest Librayry to communicate / download with Internet.
For example, for an news app I download latest news in JSON (with a PHP script on a web server) and store datas with SQLite. If you need a little explanation of JSON with iPhone, check here (in french, but source codes are in english ^^)
When I need to download an image, I use ASIHTTPRequest and a queue to avoid downloading to much files at the same time.
If you want more information about a step, just say it.
Good Luck !
NURLConnection 及其委托方法是您的朋友。
不要被使用 -sendSynchronous 方法的诱惑所诱惑(现在我想起来,如果您需要身份验证,您可能无论如何都无法使用)。
NURLConnection is your friend, along with its delegate methods.
Don't be lured by the temptation to use the -sendSynchronous method (which, now that I think about it, if you require authentication, you probably can't use anyway).