This is the sample code for creating a connection:
// 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];
if (theConnection) {
// Create the NSMutableData that will hold
// the received data
// receivedData is declared as a method instance elsewhere
receivedData=[[NSMutableData data] retain];
} else {
// inform the user that the download could not be made
}
It is commented that "receivedData is declared as a method instance
elsewhere". This part is not clear to me.