I have a Popover which I present from a bar button over a navigation controller. This popover will act as a menu. When a row is pressed I want to push a new view controller on the navigation stack.
How do I communicate between the two classes though? The table in the popover is controlled via a UITableViewController subclass and the class that presents 开发者_如何学JAVAthe popover is a view controller on the navigation stack.
Any ideas, I'm really stuck on this one.
You can use NSNotificationCenter
. Just add an observer in the main view somewhere (probably in the viewDidLoad
method. Then when the row is tapped in the UIPopoverController
post the notification. Here's a guide to help you out.
精彩评论