title: Disable paste in uitextfield in iOS5
body: <p>I'm attempting to disable paste in a textfield using the following code:</p>
  
  <pre><code>-(BOOL)canPerformAction:(SEL)action withSender:(id)sender {
  
    if ([UIMenuController sharedMenuController]) {
  
      [UIMenuController sharedMenuController].menuVisible = NO;
  
    }
  
    return NO;
  }
  </code></pre>
  
  <p>I've this code in other projects and its worked, however in my current project it just gets called multiple times and then displays the paste menu item.</p>
  
  <p>This only thing that I can see that is different is that in this project the viewcontroller where the above code lives is the child of a custom viewcontroller.</p>
  
  <p>EDIT</p>
  
  <p>It's not showing the menu option when I run it with in the simulator with iOS4.3 as opposed to iOS5</p>