连接到服务器,检索数据并将其存储在本地数据库中
这次不是本地问题,我现在必须连接到远程服务器并从那里获取信息,并且我想将该信息存储在 iPhone 应用程序的本地数据库中。我什至不知道如何开始这个过程。 另一个问题是我也需要从给定路径检索图像并将该图像存储在我的本地文件夹中。
请帮我解决这个问题。
谢谢
This time it's not about local problem, I now have to connect to remote server and fetch information from there, and that information I want to store in my local database of an iPhone application. I don't have any clue of even how to start this process.
Another issue is I need to retrive an Image too from given path and to store that image in my local folder.
Please help me with this.
Thank You
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果可以选择通过 HTTP 获取信息,我建议您查看优秀的 ASIHTTPRequest 库。至于本地存储这些信息,请查看Apple的 Core Data 框架——Xcode 内置了对此框架的支持。
从 URL 检索图像相当简单:
然后您可以将该图像存储在应用程序的文档文件夹中或作为核心数据中的原始数据。
If fetching the information over HTTP is an option, I'd recommend you look into the excellent ASIHTTPRequest library. As for storing this information locally, take a look at Apple's Core Data framework—support for this framework is built into Xcode.
Retrieving an image from a URL is fairly straightforward:
You can then store this image in your application's documents folder or as raw data in core data.