Beyond Basic Networking

There are many aspects of basic networking that I haven’t gone into in this chapter. For example:

  • An NSURLRequest has a cache policy, which you can set to determine whether the request might be satisfied without freshly downloading previously downloaded data.
  • An NSURLRequest to be handed to an NSURLConnection can specify that it wants to use the FTP, HTTP, or HTTPS scheme, including POST requests.
  • An NSURLConnection can handle redirects and authentication.

See the URL Loading System Programming Guide.

You can also get as deep into the details of networking as you like; see in particular the CFNetwork Programming Guide.

Apple provides a generous amount of sample code. See in particular SimpleURLConnections, AdvancedURLConnections, SimpleNetworkStreams, SimpleFTPSample, and MVCNetworking.

Get Programming iOS 6, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.