Despite the fact that I have made this far in the book I think I just realized something that I did not understand about “Delegates”.
I noticed that in implementing the NSURLConnection delegate methods in this chapter, the three methods implemented had the connection argument supplied on each of them and was called “theConnection”. This is obviously not the ivar holding the connection pointer in our class so I think doing this forced me to understand that it is the NSURLConnection itself calling the delegate methods and placing itself in that first argument position. The fact that that argument is not used in any of our overrides in this example is not important to my question, but just for verification:
[ul]The actual NSURLConnection when it was allocated and initialized, designated this class as its delegate; so when this class’s connection (no matter what it is called) is used, the pointer to that connection is placed as the first argument in the these delegate methods.
From this, and before I try the challenge at the end of the chapter, in general a delegate, and any delegate methods (if implemented), has the object that it is a delegate of available via a pointer to it, just because it was specified as the delegate.[/ul]
Hopefully I got my idea across here, and it is correct, because if so, a light bulb just popped on.