Json-iPhone应用程序:uitableview和uiwebview [英] Json - iPhone app: uitableview and uiwebview

查看:142
本文介绍了Json-iPhone应用程序:uitableview和uiwebview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Xcode和Json还是很陌生.

I am quite new to Xcode and Json.

在我的应用中,我可以通过表视图浏览页面(向下钻取).我现在想要做的是使用Json创建我的表视图,然后当我在uitableview中选择一个单元格时,它将通过uiwebview进入下一页的网站.

In my app, I have navigation through pages via tableviews (drill down). What I want to do now, is to use Json to create my tableviews and then when I select a cell in the uitableview, it will go to a website through the next page via a uiwebview.

我将如何做?

推荐答案

  1. 使用解析器解析您的j 儿子
  2. 将已解析的响应创建为表视图的数据模型.您可以使用字典/数组使事情保持简单

  1. Parse your json using a parser
  2. Create the parsed response as a data model for table view. You can use a Dictionary/array to keep things simple

实现tableview委托方法并获取选定的索引

Implement the tableview delegate methods and get the selected index

在didselectatrowindex方法上,您创建一个新视图,从模型中获取URL并将其加载到Web视图中.

On didselectatrowindex method you create a new view, fetch the url from your model and load it into the webview.

我可以编写一些代码,但是那真的是您所要求的太多.如果您被上述任何一个步骤卡住,请发表评论.我很乐意为您提供帮助.

I could write some code but thats really too much you are asking for. If you get stuck in any of the steps above, do leave a comment. I will be glad to help you out.

这篇关于Json-iPhone应用程序:uitableview和uiwebview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆