I can’t seem to be able to figure this out: after we have defined the Bezier path object using the arc with center method, we define a new - different! - object of type UIColor, and instantiate it using the convenience method to represent a certain grey color. Then we send this color object the magical method “set stroke”. Next thing that happens is that we ask the bezier path object to draw itself using the “stroke” method. I can understand how we deal with two objects and send them methods. What I do not understand is how those two objects magically communicate in the background; how does the bezier path object now know about the UIColor object and its newly set property (the grey color)? There seems to be nothing besides the context (the arrangement in which those objects are used) that seems to convey to the system which object (the Bezier path) to apply the UIColor (light grey) to. We never, for example, sent a message to either object to associate the other object - e.g., we didn’t send a pointer to the Bezier path object along to the UIColor object when we sent the color object the “setStroke” method.
Could somebody please clarify how this magic happens? I looked a bit in the UIColor reference to “setStroke”. All it says is “Sets the color of subsequent stroke operations to the color that the receiver represents.” The object magically seems to realize when a subsequent stroke operation happens. But nothing clarifies how this happens. This behavior is freaking me out…
Anybody else realizes this - or am I alone on feeling completely puzzled? Am I in for more of such “magic”? Because, if so, I feel I’d need to be filled in more on what to expect.