NSNotification for UIMenuControllerWillShowMenuNotification

Posted by Bob Keathley on Stack Overflow See other posts from Stack Overflow or by Bob Keathley
Published on 2010-06-02T16:48:44Z Indexed on 2010/06/02 16:54 UTC
Read the original article Hit count: 362

Filed under:
|

I am trying to use the NSNotificationCenter to get UIMenuControllerDidShowMenuNotification from a UIWebView. I have the following code in my ViewDidLoad method:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuControllerWillHide:) name:UIMenuControllerWillHideMenuNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(menuControllerWillShow:) name:UIMenuControllerWillShowMenuNotification object:nil];

And methods: - (void)menuControllerWillHide:(NSNotification *)notification {

}

  • (void)menuControllerWillShow:(NSNotification *)notification { [[self navigationItem] setRightBarButtonItem:highlightBtn animated:NO]; }

But I never get the Notifications? Any help would be helpful

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk