iOS popovers作为菜单教程 [英] iOS popovers as menu tutorial
问题描述
我正在写一个iPad应用程序,对于目标C来说是非常新的。我目前正试图使用popover作为视图控制器中的菜单。我理解如何设置弹出窗口并有一个tableview,用户从中选择一个项目。但是,我不知道如何将信息传递回容器视图,其中包含popover。 didSelectRowAtIndexPath
将在 UITableViewController
中调用,它可能在popover视图控制器内。
I am writing an iPad app and am very new to objective C. I am currently trying to use a popover as a menu within a view controller. I understand how to set the popup up and have a tableview in it for a user to select an item from. However, I am not sure how to then pass the information back to the container view which holds the popover. didSelectRowAtIndexPath
will be called within the UITableViewController
which is presumably inside the popover view controller. Can anyone point me in the right direction for how to get this information back to the container?
提前感谢!
推荐答案
您需要使用委托。它在这种情况下是非常常用的模式。我对此 SO 类似问题有答案问题的例子。如果您之后仍然不清楚,请告诉我们。
You need to use delegate. It is very commonly used pattern in this situation. I have an answer to this SO similar question with an example. Let me know if you still are not clear afterward.
这篇关于iOS popovers作为菜单教程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!