How to customize the pop up menu in iPhone?
<p>The application I'm creating needs a function like user selects some text, a pop up menu shows, and user clicks "search" menu to perform a search directly.</p>

<p>Problem is the current pop up menu provided by UIMenuController doesn't support to be extended. So my thought is to subscribe "UIMenuControllerDidShowMenuNotification", get the frame of pop up menu, and display the "search" button right aside.</p>

<p>But during the implementation, I met a strange problem, the notification seems never be sent, means after the menu shown, I still cannot be notified, following are the key section of code.</p>

<pre>
- (void)viewDidLoad {
    [super viewDidLoad];

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

- (void)viewDidUnload {
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
    [[NSNotificationCenter defaultCenter] removeObserver:self 
                                                    name:UIMenuControllerDidShowMenuNotification
                                                  object:nil];

    self.textView = nil;
    self.searchBar = nil;

}

- (void)menuDidShow:(NSNotification *)notification {
    NSLog(@"menu did show!");
}
</pre>

<p>The code is too simple to make mistake, can someone help me to understand what's going on? Or what did I miss?</p>
