JSON GET and POST

2019-06-12 22:29发布

I am learning iOS app development. I have JSON data coming from one of the sites in the form of Dictionary within an Array and within that Dictionary I have another Array and that contains another Dictionary. for ex ,

Now I want to deserialize it and use it in my iOS app and also I have to post some data like a comment back to the server.The comment by teacher will be a POST to the server.

I hope the question makes sense.

I am stuck on how to deserialize this and use POST to server.

Any help is appreciated. Thanks in advance.

1条回答
做个烂人
2楼-- · 2019-06-12 23:04

There are a couple of parts to your question:

1) To get the JSON data into a format which can easily be manipulated by your program, it's easiest to take an existing open-source JSON parser library and integrate it into your app. I like SBJSON. If you go to that site, it has instructions on including and using the library in your project.

2) To post a reply to the server, you need to know what format it expects the data in. Is your app interacting with an existing website (where a user could go to a page and fill out a form), or is it talking to an API?

查看更多
登录 后发表回答