Asynchronous request
suggest changeNSURLConnection is deprecated. Prefer URLSession. The delegate callbacks are delivered on the run loop of the thread that starts the connection, so create it on the main thread (or another thread that is running a run loop).
// Create the request instance.
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://google.com"]];
// Create url connection and fire request
NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:request delegate:self];
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents