Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一些属性,以便我可以从模式弹出视图控制器中引用呈现视图控制器。好像应该有一个。parentViewController似乎不是正确的视图控制器。
parentViewController
对于这个线程的未来访问者,从 iOS5 开始,视图控制器有一个“presentingViewController”引用。
我总是:
为我的弹出视图控制器创建我自己的子类。
向它添加一个“父” UIViewController 变量
在我分配/初始化它之后,在我展示它之前设置“父”。
当我需要它时,从我的弹出窗口中引用我的“父”变量。