xcode - How can I dismiss NSPopover when not active? -


i have menu bar app displays nspopover when status icon pressed. problem close if click again on status icon.

i want view close when click anywhere outside popover itself.

i tried changing popovers attributes behaviour transient issue persists.

what best way can achieve this?

use uipopovercontroller instead of nspopover , present in required viewcontroller using below method

    - (void)presentpopoverfromrect:(cgrect)rect inview:(uiview *)view permittedarrowdirections:(uipopoverarrowdirection)arrowdirections animated:(bool)animated 

so if other view clicked apart popover, dismiss automatically.


Comments