Your popoverButton
is probably not a subview of self.view
, so using its frame
relative to that will result in an incorrect rectangle. Use popoverButton.bounds
for the rectangle and popoverButton
for the fromView
parameter instead.
Note that the fromView
parameter does not determine in which view the popover will be shown (it'll always be on top of everything), but rather relative to which view's coordinate system the rectangle should be interpreted.