I was just going back through the Callbacks chapter for deeper understanding and stumbled upon something that I’m missing fundamentally. I get why you need to declare variables and that you create a pointer and create an object to put there.
This makes sense:
Mostly because I understand allocating some memory for variables and methods in an object.
But looking at this got me thinking:
__unused NSURLConnection *fetchConn = [[NSURLConnection alloc] initWithRequest:request
What makes the NSURLConnection object “do” what it does? It this just a function of all NSURLConnection objects? Do they, upon creation on the heap, just start doing what you ask? If so, is the following statement true about the code above: “A NSURLConnection pointer is declared then an NSURLConnection instance is created on the heap then upon initialization starts executing outside the main loop/thread.” (Be gentle, I’m not up on my thread understanding yet.)
I’m hoping that makes sense. Any clarifications would be welcome.