Json - iPhone app: uitableview and uiwebview

此生再无相见时 提交于 2019-12-11 20:39:01

问题


I am quite new to Xcode and Json.

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.

How will I do this?


回答1:


  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

  3. Implement the tableview delegate methods and get the selected index

  4. 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.



来源:https://stackoverflow.com/questions/5866968/json-iphone-app-uitableview-and-uiwebview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!