I've recently upgraded to iOS 6 Beta and am having some issues. (I know it's a beta, but I'm not yet convinced that it's actually iOS 6-related.)
The issue has the following parameters:
UITableViewCell
with UIButton
objects that generate UIPopOver
objects, presented from the frame of the UIButton
that was tapped.UIPopOver
is displayed and then the iPad is rotated.UIPopOver
when the rotation animation completes and then re-displays the UIPopOver
.Relevant Information:
UIPopOver
is dismissed and re-displayed correctly.UIPopOver
objects presented from UIBarButton
objects in a UIToolbar
. I experience no problems with those transitions.Here's the code that executes related to the rotation:
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
if ([self PopOver]) {
[[self PopOver] dismissPopoverAnimated:YES];
[self setPopOver:nil];
[self ButtonPressed:[self TouchedCell]];
}
[[self TableView1] reloadData];
[[self TableView2] reloadData];
}
- (void)ButtonPressed:(Cell *)cell {
[self setTouchedCell:cell];
NSString *nibName = @"View";
if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) {
nibName = @"View-iPad";
}
ViewController *vc = [[ViewController alloc] initWithNibName:nibName
bundle:nil];
if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) {
UIPopoverController *popOver = [[UIPopoverController alloc]
initWithContentViewController:vc];
[self setPopOver:popOver];
[popOver setDelegate:self];
[[self PopOver] setPopoverContentSize:CGSizeMake(320, 320)];
[popOver presentPopoverFromRect:[[cell CheckButton] frame]
inView:[cell contentView]
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
} else {
// iPhone doesn't use PopOvers...
}
}
Anyone know what I should do next?
Here's my official answer - I think your popover is trying to display offscreen, or maybe from an already recycled cell. ;)