Introduction to iOS Web data download and JSON parsing
In this article, I'm going to show you how to use nsurlconnection to download data from the Web, parse the JSON data format, and display the asynchronous download display of data and images.
Points of knowledge involved:
- Nsyrlconnection Asynchronous Download and encapsulation
- JSON format and JSON format parsing
- Data display and use Sdwebimage to download images asynchronously
Content
Introduction to Network Download basics
Nsurlconnection use
JSON format description and formatting tools
- Implementation of a completion page (including model and sdwebimage)
What is a Web application?
The popular use of network applications is to send, receive and process data using the network.
The program structure of network application
What is the general use of MVC? Mainly for the convenience of maintenance, and development can have a clear framework.
A common form of network interface, which uses Http,socket sockets, FTP, and so on.
Use of Nsurlconnection
_url = url; = target; = action; = [[Nsmutabledata alloc] init]; = [[nsurlconnection Delegate
JSON Data description and usage
JSON is a markup language for JavaScript and is easy to use.
Where "" represents a string, [] represents an array, and {} represents a key-value pair. are usually cascading styles.
In iOS development, you can use the
Nsjsonserialization in the
Jsonobjectwithdata function to parse it.
Web data download and JSON parsing for iOS