I'm running the following example code from Apple -
NSString *requestURL = [[NSString alloc] initWithString:@"http://google.com/"];
NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:requestURL] cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:60.0];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if(theConnection) {
NSLog(@"The connection has started...");
} else {
NSLog(@"Connection has failed...");
}
But the delegate methods below aren't being called. Can anyone please help me out?
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {