Json - iPhone app: uitableview and uiwebview

2019-08-17 02:19发布

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条回答
Rolldiameter
2楼-- · 2019-08-17 03:07
  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.

查看更多
登录 后发表回答