ipad弹出窗口问题
我有一个委托文件,一个视图控制器和一个UIPopoverController
我的PopoverController是在委托文件中定义的。
当我单击视图控制器的按钮时,会显示弹出窗口。
视图控制器还包含一种名为“refreshviewnow”的方法。
当我单击 PopoverController“提交按钮”时,我想调用该 refreshviewnow 函数。
我应该在提交按钮事件上写什么?
I have one delegate file, one View Controller and one UIPopoverController
My PopoverController is defined in delegate file.
when I click on the view controller's button, the popover is shown.
The view controller also contains one method named "refreshviewnow".
When I click on the PopoverController "submit button", I want to call that refreshviewnow function.
What should I have to write on submit button event ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要确保并将 PopoverController 的委托属性设置为视图控制器。然后在“提交按钮”中,您可以调用委托上的方法。
祝你好运。
You need to make sure and set the delegate property of the PopoverController to the View Controller. Then in the "submit button" you can invoke the method on the delegate.
Good Luck.
我不确定“提交按钮”是什么意思(也许您应该发布一些您正在使用的代码),但是如果您尝试调用同一控制器中的方法,您会这样做:
编辑:
I am not sure what you mean by "submit button" (maybe you should post some of the code you are using), but if you are trying to call a method that is in the same controller, you would do it like this:
EDIT:
我现在得到了答案。
在View Controller文件中为方法refreshviewnow添加观察者。
当弹出窗口将要关闭时发布通知。
I got the answer now.
add observer in View Controller file for method refreshviewnow.
post the notification when popover is going to dismiss.