Question

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:

  1. Custom UITableViewCell with UIButton objects that generate UIPopOver objects, presented from the frame of the UIButton that was tapped.
  2. The UIPopOver is displayed and then the iPad is rotated.
  3. My view dismisses the UIPopOver when the rotation animation completes and then re-displays the UIPopOver.

Relevant Information:

  1. The first rotation proceeds fine; the UIPopOver is dismissed and re-displayed correctly.
  2. The second rotation (EVERY TIME) is what breaks the app.
  3. I have a symbolic breakpoint set, but I'm not getting any useful information.
  4. I'm doing the same thing with UIPopOver objects presented from UIBarButton objects in a UIToolbar. I experience no problems with those transitions.
  5. This is a new problem that is related to code that hasn't changed in a good while.
  6. The error I receive is: "warning: Attempting to create USE_BLOCK_IN_FRAME variable with block that isn't in the frame."

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?

Was it helpful?

Solution

Here's my official answer - I think your popover is trying to display offscreen, or maybe from an already recycled cell. ;)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top