Simple: In the view, I represent the UIPopoverController in a CGRect using presentPopoverFromRect ... and neither the arrow nor the popover frame even comes close to the coordinates I requested in the rectangle I entered. Any clues? I tried to figure it out myself, but I give up. Here is the code:
if(!myContentController){
myContentController = [[MyContentController alloc] initWithNibName:myNibName bundle:[NSBundle mainBundle]];
}
if(!popover){
popover = [[UIPopoverController alloc] initWithContentViewController:myContentController];
}
else{
[popover setContentController:myContentController];
}
popover.delegate = self;
CGPoint touchPointInView = [self touchPoint];
popover.ContentSize = myPopoverSize;
[popover presentPopoverFromRect:CGRectMake(touchPoint.x,touchPoint.y,myPopoverSize.width,myPopverSize.height)
inView:self.view
permittedArrowDirections:UIPopoverArrowDirectionAny
animated:YES];
What will happen next? popover does not show where it should be. If I go through {0,0}, it is displayed in the middle of the screen, as if the size of the view was (768,512). I checked all the sizes of the view, and they are all in order, frame, border, etc ..... Does anyone know what I'm doing wrong?
source
share