Does NSURLConnection automatically send messages to the class that initialized it or how does it work because I did not reference it in my header file.
+1
A:
No, you need to specify the delegate, as in this example from the URL Loading System Guide
// Create the request.
NSURLRequest *theRequest=[NSURLRequest
requestWithURL:[NSURL URLWithString:@"http://www.apple.com/"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
// create the connection with the request
// and start loading the data
NSURLConnection *theConnection=[[NSURLConnection alloc]
initWithRequest:theRequest delegate:self];
(note the delegate:self
part).
David Gelhar
2010-07-13 14:33:27
One caveat: NSURLConnection retains its delegate. This caused me some fairly major headaches in the past...
robinjam
2010-07-13 14:38:55
Thanks I will make a note of this!
TheLearner
2010-07-13 14:49:15