In your code you create two objects, [UIFont fontWithName:@"System" size:12]
, and [UIFont fontWithName:@"Courier" size:30]
.
Initially, your labelFont
variable points to the first font object. Then you copy that pointer in the assignments to fonts of the three labels. At this moment, you have four pointers referencing the same object - namely, the object returned by the [UIFont fontWithName:@"System" size:12]
call.
Next, you change labelFont
to point to [UIFont fontWithName:@"Courier" size:30]
. Once you do that, the labelFont
starts pointing to that new object; it no longer points to the old object. However, the three labels are still pointing to the old font, so their appearance does not change.