问题
I have an iOS app where my architecture is:
VC1 => MVC1
I want to access to an VC1's IBOutlet (aboutBtn). I tried making a delegate in MVC1 and setting VC1 as delegate, but I still can't access it. How would I do it?
回答1:
I would just create an instance variable in MVC1 and pass the IBOutlet variable you're trying to access from VC1 to MVC1. For example, you could call something like MVC1.referenceToSomeIBOutlet = self.someIBOutlet
from VC1. That will give MVC1 access to the passed in IBOutlet object.
来源:https://stackoverflow.com/questions/7434027/access-to-an-iboutlet-in-a-modal-views-parent-view