Access to an IBOutlet in a modal view's parent view

孤人 提交于 2019-12-25 08:39:47

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!