执行查询后将数组列表从 servlet 发送回 iPhone 应用程序

发布于 12-29 12:45 字数 187 浏览 3 评论 0原文


我有一个简单的 iPhone 应用程序,我想做的是:
我有一个选择器视图,我必须通过向 servlet 发送请求并执行查询并将结果发送回来填充它。
问题是 servlet 将结果作为字节流发送,而我需要它作为数组。
问题是:
如何从 servlet 向应用程序发送数组以及如何处理?

I have a simple iPhone application, and what I am trying to do is the following:
I have a picker view, and I have to fill it by sending a request to servlet and execute a query and send the the result back.
The problem is that the servlet is sending the result as a stream of bytes and I need it as an array.
The question is:
How to send an array from servlet to the application and how to deal with it?

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

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

发布评论

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

评论(1

云胡2025-01-05 12:45:22

您没有提及您是否控制该 servlet。如果你确实控制它,你可以将响应格式化为 iOS plist 格式,然后直接将结果读入(比如说)NSArray。如果您不控制 servlet,那么您需要了解它返回的数据的格式并自行将其格式化为 NSArray。

You don't mention whether or not you control the servlet. If you do control it you can format the response in iOS plist format and so directly read the result into a (say) NSArray. If you don't control the servlet, well, you need to understand the format of the data it returns and format it yourself into an NSArray.

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