views:

28

answers:

1

I am trying to listen for UIMenuController Notification in iphone sdk 3.0 .

But it seems that my notification can never get called. Here is my code:

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

and my method

- (void)menuControllerWillShow:(NSNotification *)notification {
   NSLog (@"Call here");
}

But it never prints out "Call here", breakpoint never gets stop as well. Does anyone know how to solve this problem.

I know the approach of setMenuItems for iphone sdk 4.0 but I am working for sdk 3.0.

My original problem is that I am trying to catch the UIMenuController event to show a toolbar of buttons like: "Do A", "Do B" for the text. If anybody knows any solution for this, I also appreciate

+1  A: 

Well, several people also had your problem:

http://stackoverflow.com/questions/2959774/nsnotification-for-uimenucontrollerwillshowmenunotification

http://www.iphonedevsdk.com/forum/iphone-sdk-development/36198-uimenucontrollerwillshowmenunotification-not-working.html

http://www.iphonedevsdk.com/forum/iphone-sdk-development/50605-uimenucontroller-wont-send-notification.html

The last one is interesting. This issue that you have appears to be a bug in pre-4.0. I couldn't find anything about whether there was a solution.

No one in particular
yeah, I see it a lot when doing google. It is my attemp (may be useless) to see if anybody in SO having a solution
vodkhang