In Chapter 9, the first comment in the example code for the “For the More Curious: Overriding Autorotation” exercise has really thrown me: “Assume ‘button’ is a subview of this view controller’s view”. I tried to apply this exercise to the HeavyViewController project earlier in the chapter, but I can’t figure out how to get a reference to one of the UIButtons in the nib.
I guess my question is this: how would you get a reference to a UIButton archived in a nib so that you could manipulate it programatically in a view controller subclass’s willAnimateRotationToInterfaceOrientation:duration:? I naively thought I could just add a UIButton pointer as a UIOutlet in my view controller subclass and bind that outlet to the UIButton in the nib. My understanding was that when the nib loaded, the UIButton would be instantiated and then when the HeavyViewController instance is inserted as the File’s Owner, my outlet binding would wire up the UIButton by assigning the instantiated button to my “button” pointer. Is my understanding flawed?