如何在 Objective-C 中实现网站数据检索?

发布于 2024-10-07 20:18:30 字数 325 浏览 5 评论 0原文

我想用 Objective-c 编写一个程序,从网站上获取一些体育统计数据,并将它们存储起来,以便我可以对它们进行一些统计分析。我对 Objective-C 有一点经验,但最近一直在使用 Java,已经忘记了 Objective-C 语言的很多基本组织。

我想知道是否有人可以推荐:

为此目的存储数据的最佳方式?

从网站获取数据的最佳方法以及我需要重写/实现哪些类才能做到这一点? 更具体地说:我想下载网站的内容,并筛选 HTML 代码,但不知道该怎么做。

我只是需要一个起点,因为我现在有点不知所措。预先感谢这个乐于助人且深思熟虑的社区,我期待成为其中的一员。

I want to write a program in Objective-c that grabs some sports stats off a website and stores them in such a way that I can run some statistical analysis on them. I have a little experience with objective-c but have been working with java more recently and have forgotten a lot of the basic organization of the objective-c language.

I was wondering if someone could recommend:

the best way to store data for this purpose?

the best way to go about getting data from the website and what classes I will need to override/implement to do this?
more specifically: I want to download the website's contents, and sieve through the HTML code, but am not sure how to go about this.

I just sort of need a starting point because I am a little overwhelmed right now. Thanks in advance to this helpful and thoughtful community, which I look forward to being a part of.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

日暮斜阳 2024-10-14 20:18:30

对于大多数数据存储,即使您不需要将其存储在磁盘上,也值得使用核心数据,因为它可以非常方便地设计数据模型,并且可以省去很多数据管理工作。

至于从网站上获取数据,有很多因素会影响这一点。该网站在您的控制范围内吗?或者网站有什么API吗?或者是抓取网站并在 iPhone 端进行处理的情况?

for most data storage, its worth using core data, even if you don't need to store it on disc, as it can be very convenient for designing the data model, and gets a lot of the data management stuff out of the way.

as for getting the data off of the website, there are a lot of things that affect this. is the website within your control? or does the website have any kind of API? or is it a case of scraping the website, and processing at the iPhone side of things?

暮年慕年 2024-10-14 20:18:30

您需要的不仅仅是 [NSData dataWithContentsOfURL:url]

Do you need something more than [NSData dataWithContentsOfURL:url]?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文