如何使用 Web 请求结果(xml、plist 等)作为 UITableView 的数据源

发布于 2024-09-27 04:34:46 字数 121 浏览 0 评论 0原文

我想使用 Coldfusion Web 查询结果来填充 iOS 中的 UITableView。查询结果以字符串形式返回,我想我需要将它们转换为 NSArray 或 NSDictionary...

谢谢,Phill

I want to use coldfusion web query results to populate a UITableView in iOS. The query results come back as a string and I guess I need to convert them to NSArray or NSDictionary...

Thanks, Phill

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

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

发布评论

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

评论(2

凑诗 2024-10-04 04:34:46

您所需要做的就是实现 UITableViewDataSource 协议,并将实现挂接到表视图的 dataSource 出口。这样你就得到了冷融合结果,然后告诉表视图重新加载。查看协议的文档以了解您需要实现哪些方法。

All you need to is implement the UITableViewDataSource protocol, and hook the implementation up to the table view's dataSource outlet. So you get your coldfusion results, then tell the table view to reload. Look at the documentation for the protocol to see which methods you need to implement.

无人问我粥可暖 2024-10-04 04:34:46

嗯,这取决于返回结果的格式。如果它是 XML,您将需要解析 XML,将结果保存在某种数据对象中。然后使用 UITableViewController 的 cellForRowAtIndexPath 方法来访问正确的结果并显示它。

查看 SeismicXML 示例代码。我认为这将帮助您实现您想要的目标:

https://developer.apple.com/library/ios/#samplecode/SeismicXML/Introduction/Intro.html

Well, it depends on what format the results come back as. If it's XML, you'll want to parse the XML, keep the results in some sort of data object. Then use your UITableViewController's cellForRowAtIndexPath method to access the right result and display it.

Take a look at the SeismicXML sample code. I think it will go a long way to getting you where you want to go on this:

https://developer.apple.com/library/ios/#samplecode/SeismicXML/Introduction/Intro.html

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