Building the Request

First set up the URL (in the MessageBoard-Prefix.pch file) so that the app can make calls to the right location:

#define kMessageBoardServerURLString@"http://freezing-cloud-6077.herokuapp.com/messages.json"

In the ICFViewController.m implementation, look at the viewWillAppear: method. This code will initiate the request to the server:

NSURL *msgURL = [NSURL URLWithString:kMessageBoardURLString];NSURLRequest *msgRequest =[NSURLRequest requestWithURL:msgURL                 cachePolicy:NSURLRequestUseProtocolCachePolicy             timeoutInterval:60.0];NSURLConnection *theConnection =[[NSURLConnection alloc] initWithRequest:msgRequest                                 ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK 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.