Last updated by at .

iOS Programming Recipe 16.2: Populating A UITableView With Data From The Web – iOS 7 and AFNetworking 2.0

This article will be nearly the same as Recipe 16, except that it will cover AFNetworking 2.0 and iOS 7 instead.

Assumptions

  • You have a grasp on Xcode basics. If not go get some education here.
  • I also recommend reading the other two tutorials on creating table view as I’ll be building on some of the concepts in those tutorials: Recipe 11 Part 1 & Recipe 11 Part 2

[Read more…]

iOS Programming Recipe 4: Using NSURLConnection

URL Requests

Making URLS requests on the Mac is as simple as

  1. open terminal.app
  2. then typing the following

$ curl https://alpha-api.app.net/stream/0/posts/stream/global

This retrieves the APP.NET global stream. If you are not familiar with APP.NET, it is a Twitter like service that sports an open api, similar to how Twitter used to be.

The result of running curl is a large JSON string representing the afore mentioned global stream as shown below

curl result

Unfortunately making URL requests in your iOS application isn’t quite this easy, but fortunately NSURLConnection does most of the heavy lifting for you.

NSURLConnection

The NSURLConnection class reference, located on Apple’s developer website has the following description

An NSURLConnection object provides support to perform the loading of a URL request. The interface for NSURLConnection is sparse, providing only the controls to start and cancel asynchronous loads of a URL request.

Which basically says NSURLConnection is used to perform URL requests, but how do you create the actual requests?

NSURLRequest to the rescue!

[Read more…]

css.php
Privacy Policy