I've encountered strange problem in UIPopOverController. Normally, I present popover this way:
[popoverVC presentPopoverFromRect:sender.frame
inView:sender.superview
permittedArrowDirections:UIPopoverArrowDirectionLeft
animated:NO];
However, sometimes there is no enough space on the right side of the button (sender) and the popover is displayed below the button with UIPopoverArrowDirectionUP. It make sense - if popover can't be displayed properly, controller trys to display it with different arrow.
But when I moved my button (sender) about 10 pixels to the left, popover doesn't behave this way. There is still no enough space to display it properly but it doesn't change its arrow although popover is ~20px wide so it's way too small.
Is there any way to say popovercontroller: "If popover does not have enough space to display all content, change arrow direction" ?