Search code examples
iosobjective-cuitableviewipaduipopovercontroller

PopOver issue in iPad


On my landing view's navigation bar I have button which when clicked displays a UIPopoverController and I init the contentViewController with a class named A. I use the following code to display my UIPopoverController:

[self.popoverController presentPopoverFromRect:popoverRect
                                    inView:self
                  permittedArrowDirections:UIPopoverArrowDirectionUp
                                  animated:YES];

This works fine and a tableView is displayed inside the UIPopoverController, now the thing is I have to display another UIPopoverController when user selects any one row of the displayed UITableView. The thing is when I try to add the new UIPopoverController it isn't getting displayed. After trying a lot of things, I have noticed the inVIew : self might be at fault. At the time of displaying the first UIPopoverController when I do po self the name of the view which is displayed is printed. But for the second UIPopoverController which is supposed to be displayed after selecting a row, the po self prints the name of the class which I want to display in the second UIPopoverController. Which I think maybe the reason why the UIPopoverController in not getting added to the view and hence not being displayed. Please let me know how should I solve this. Thanks.


Solution

  • It appears you are asking to display a popover when a popover is already showing. That's impossible. You cannot display two popovers simultaneously. You should rethink your interface.