Note that there are some explanatory texts on larger screens.

plurals
  1. POUIPopoverController in UITabBarController works for only once
    text
    copied!<p>Now i'm working on an iPad App, in which there is a <code>UITabBarController</code> with 9 view controllers and 9 <code>UITabBarItems</code>. When i click one item, called "ET", a <code>UIPopoverController</code> appears above the <code>UITabBarItem</code>, everything went fine for the first time, after i click on somewhere else outside the popover to make it disappear, then i click "ET" again it doesn't work. After some debugging, i found the view controller supposed to display in popover controller is removed from <code>UITabBarController.viewcontrollers</code>, now <code>UITabBarController</code> only has 8 view controllers. I've no idea where i removed it, here is my code for display the popover controller </p> <pre><code>-(void) PopViewController:(UIViewController*)pVC rect:(CGRect)rect type:(int)nType { if (pVC == NULL) return; [self PushViewController:NULL type:0]; GTJAMyNavigatorViewController* navigationController = [[GTJAMyNavigatorViewController alloc] initWithRootViewController:pVC]; [navigationController setNavigationBarHidden:YES animated:NO ]; if ([pVC isKindOfClass:[TZTUIETViewController class]]) { self.popoverVC = [[UIPopoverController alloc] initWithContentViewController:navigationController]; } self.popoverVC.delegate = self; [navigationController setPopover:self.popoverVC]; [self.popoverVC presentPopoverFromRect:rect inView:self.view permittedArrowDirections:UIPopoverArrowDirectionDown animated:YES]; NSLog(@"%d",[self.popoverVC retainCount]); </code></pre> <p>}</p> <p>here is the code of dismiss delegate method</p> <pre><code>- (void)popoverControllerDidDismissPopover:(UIPopoverController *)popoverController { if (self.popoverVC &amp;&amp; self.popoverVC == popoverController) { [((TZTUITabBar*)self.tabBar) UndoSelect]; [self.popoverVC release]; self.popoverVC = NULL; } NSLog(@"%d",[self.popoverVC retainCount]); return; </code></pre> <p>}</p> <p>i've made self.popoverVC strong property, so can anybody help? Thanks !</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload