简体   繁体   English

如何从 Objective-C 中的 SQL 数据库中获取数据?

[英]How to get data from an SQL database in Objective-C?

I know this has probably been answered before, but I cannot find much information on this subject.我知道这可能以前已经回答过,但我找不到关于这个主题的太多信息。 The only information I have found is that I need to use an SQL database, thus leading me to ask this question.我发现的唯一信息是我需要使用 SQL 数据库,因此导致我问这个问题。

I am making an iPhone app that needs to store four integers, six floats, and two NSStrings online somehow (SQL sounds like the answer), and I need to be able to get the data as well.我正在制作一个 iPhone 应用程序,它需要以某种方式在线存储四个整数、六个浮点数和两个 NSString(SQL 听起来像是答案),并且我还需要能够获取数据。 Is there any documentation on the subject that might help?是否有任何关于该主题的文档可能会有所帮助? If not, how can I get the data?如果没有,我怎样才能得到数据?

The next thing I need to know is how I can set it up for hundreds of users to store and access all of the variables.我需要知道的下一件事是如何为数百名用户设置它来存储和访问所有变量。 By this I mean that each user's four integers, six floats, and two NSStrings will be totally different, and I cannot figure out how to set it up in a way that works.我的意思是每个用户的四个整数、六个浮点数和两个 NSString 将完全不同,我无法弄清楚如何以一种可行的方式进行设置。 Is there any documentation for this?有这方面的文件吗?

Thanks in advance!提前致谢!

One way单程

OData provides an SDK that allows you to consume/produce an OData service from a SQL database (or really any other data source) with objective-C on devices such as an iPhone. OData提供了一个 SDK,它允许您在 iPhone 等设备上使用 SQL 数据库(或任何其他数据源)使用/生成 OData 服务。

The SDK can be found here: http://www.odata.org/developers/odata-sdk SDK 可以在这里找到: http://www.odata.org/developers/odata-sdk

There is also a developed client on codeplex: http://odataobjc.codeplex.com/ codeplex上还有一个开发的客户端: http://odataobjc.codeplex.com/

Keep in mind you'll have to develop both the provider (data source) as well as consumer (your app).请记住,您必须同时开发提供者(数据源)和消费者(您的应用程序)。

You can get a primer on the basics of building a provider here (using VS as an example, but its roughly the same no matter your platform).您可以在此处了解构建提供程序的基础知识(以 VS 为例,但无论您的平台如何,它都大致相同)。

http://msdn.microsoft.com/en-us/data/gg601462 http://msdn.microsoft.com/en-us/data/gg601462

A side benefit of OData is that once you have a producer... then any device can feasibly use it. OData 的一个附带好处是,一旦你有了一个生产者......那么任何设备都可以使用它。 Android, Windows Phone, PHP, Javascript, the list goes on. Android,Windows 电话,PHP,Javascript,名单上。 (I don't know if you care, but you might) (我不知道你是否在乎,但你可能会)

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

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