Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

WEPopover exception when calling PresentFromBarButtonItem #219

Open
andreinitescu opened this issue Jun 28, 2014 · 0 comments
Open

WEPopover exception when calling PresentFromBarButtonItem #219

andreinitescu opened this issue Jun 28, 2014 · 0 comments

Comments

@andreinitescu
Copy link

I am using the WEPopover binding from the MonoTouch sample and it throws the following exception when calling PresentFromBarButtonItem:

Objective-C exception thrown. Name: NSInvalidArgumentException Reason:
-[UIBarButtonItem frameInView:]: unrecognized selector sent to instance 0x7e4e1330

My code is:

Popover.Initialize ();
Popover.ShouldDismiss = true;
Popover.ContentViewController = new UIViewController() {
            View = label,
            PreferredContentSize = contentSize,
            ContentSizeForViewInPopover = contentSize
};


var btnSlideMenu = this.NavigationItem.LeftBarButtonItems.First ();
Popover.PresentFromBarButtonItem (
            btnSlideMenu, 
            UIPopoverArrowDirection.Down, 
            true);

It works fine when using PresentFromRect

How to make it work?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant